eric4.E4Canvas.E4CanvasItem

Module implementing the base class of all canvas items.

Classes

E4CanvasItem Class implementing the base class of all canvas items.

Functions

None


E4CanvasItem

Class implementing the base class of all canvas items.

Derived from

object

Methods

E4CanvasItem Constructor
_adaptCanvasSize Protected method to update the size of the canvas.
boundingRect Public method to get the bounding rectangle.
drawSelected Public method to draw the widget as selected.
drawShape Public method to draw the shape.
getBrush Public method to get the current brush.
getCanvas Public method to get a reference to the canvas object.
getOrigin Public method to get the origin of the item.
getPen Public method to get the current pen.
hide Public method to hide the item.
isSelected Public method to check the items selection status.
isVisible Public method to check the items visibility.
move Public method to move the item to an absolute position.
moveBy Public method to move the item relative to its current position.
setCanvas Public method to set the items canvas.
setSelected Public method to set the items selection status.
setVisible Public method to set the items visibility.
setX Public method to set the x-coordinate of the origin.
setY Public method to set the x-coordinate of the origin.
setZ Public method to set the z-coordinate of the item.
show Public method to show the item.
update Protected method to update the canvas' changed parts.
x Public method to get the x-coordinate.
y Public method to get the y-coordinate.
z Public method to get the z-coordinate.

E4CanvasItem (Constructor)

E4CanvasItem(canvas, origin = QPointF(0.0, 0.0))

Constructor

canvas
reference to the canvas object (E4Canvas)
origin
origin of the item (QPointF)

E4CanvasItem._adaptCanvasSize

_adaptCanvasSize()

Protected method to update the size of the canvas.

This method does never shrink the canvas.

E4CanvasItem.boundingRect

boundingRect()

Public method to get the bounding rectangle.

Returns:
reference to the bounding rectangle (QRectF)

E4CanvasItem.drawSelected

drawSelected(painter)

Public method to draw the widget as selected.

painter
painter to draw on (QPainter)
x
x-position (integer)
y
y-position (integer)

E4CanvasItem.drawShape

drawShape(painter)

Public method to draw the shape.

Note: This method must be overridden by implementation classes.

painter
reference to the painter object (QPainter)

E4CanvasItem.getBrush

getBrush()

Public method to get the current brush.

Returns:
reference to the current brush (QBrush)

E4CanvasItem.getCanvas

getCanvas()

Public method to get a reference to the canvas object.

Returns:
reference to the canvas object (E4Canvas)

E4CanvasItem.getOrigin

getOrigin()

Public method to get the origin of the item.

Returns:
origin of the item (QPointF)

E4CanvasItem.getPen

getPen()

Public method to get the current pen.

Returns:
reference to the current pen (QPen)

E4CanvasItem.hide

hide()

Public method to hide the item.

E4CanvasItem.isSelected

isSelected()

Public method to check the items selection status.

Returns:
flag indicating the selection status (boolean)

E4CanvasItem.isVisible

isVisible()

Public method to check the items visibility.

Returns:
flag indicating the visibility (boolean)

E4CanvasItem.move

move(x, y)

Public method to move the item to an absolute position.

x
new x-coordinate (float)
y
new y-coordinate (float)

E4CanvasItem.moveBy

moveBy(dx, dy)

Public method to move the item relative to its current position.

dx
relative x movement (float)
dy
relative y movement (float)

E4CanvasItem.setCanvas

setCanvas(canvas)

Public method to set the items canvas.

canvas
reference to the canvas object (E4Canvas)

E4CanvasItem.setSelected

setSelected(selected)

Public method to set the items selection status.

selected
selection status (boolean)

E4CanvasItem.setVisible

setVisible(visible)

Public method to set the items visibility.

visible
visibility (boolean)

E4CanvasItem.setX

setX(x)

Public method to set the x-coordinate of the origin.

x
x-coordinate (float)

E4CanvasItem.setY

setY(y)

Public method to set the x-coordinate of the origin.

y
y-coordinate (float)

E4CanvasItem.setZ

setZ(z)

Public method to set the z-coordinate of the item.

z
z-coordinate (float)

E4CanvasItem.show

show()

Public method to show the item.

E4CanvasItem.update

update()

Protected method to update the canvas' changed parts.

E4CanvasItem.x

x()

Public method to get the x-coordinate.

Returns:
x-coordinate (float)

E4CanvasItem.y

y()

Public method to get the y-coordinate.

Returns:
y-coordinate (float)

E4CanvasItem.z

z()

Public method to get the z-coordinate.

Returns:
z-coordinate (float)

Up