eric4.E4Canvas.E4CanvasLine

Module implementing a canvas item subclass for a line.

Classes

E4CanvasLine Class implementing a line canvas item subclass.

Functions

None


E4CanvasLine

Class implementing a line canvas item subclass.

Derived from

E4CanvasItem

Methods

E4CanvasLine Constructor
drawShape Public method to draw the shape.
endPoint Public method to get the end point of the line.
move Public method to move the item to an absolute position.
moveBy Public method to move the item relative to its current position.
setEndPoint Public method to set the end point.
setPoints Public method to set the start and end points of the line.
setStartPoint Public method to set the start point.
startPoint Public method to get the start point of the line.

E4CanvasLine (Constructor)

E4CanvasLine(canvas, origin = QPointF(0.0, 0.0), end = QPointF(0.0, 0.0))

Constructor

canvas
reference to the canvas object (E4Canvas)
origin
origin of the line (QPointF)
end
end point of the line (QPointF)

E4CanvasLine.drawShape

drawShape(painter)

Public method to draw the shape.

painter
reference to the painter object (QPainter)

E4CanvasLine.endPoint

endPoint()

Public method to get the end point of the line.

Returns:
end point (QPointF)

E4CanvasLine.move

move(x, y)

Public method to move the item to an absolute position.

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

E4CanvasLine.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)

E4CanvasLine.setEndPoint

setEndPoint(x, y)

Public method to set the end point.

x
x-coordinate of the end point (float)
y
y-coordinate of the end point (float)

E4CanvasLine.setPoints

setPoints(xa, ya, xb, yb)

Public method to set the start and end points of the line.

xa
x-coordinate of the start point (float)
ya
y-coordinate of the start point (float)
xb
x-coordinate of the end point (float)
yb
y-coordinate of the end point (float)

E4CanvasLine.setStartPoint

setStartPoint(x, y)

Public method to set the start point.

x
x-coordinate of the start point (float)
y
y-coordinate of the start point (float)

E4CanvasLine.startPoint

startPoint()

Public method to get the start point of the line.

Returns:
start point (QPointF)

Up