QGraphicsPathItem¶
The
QGraphicsPathItem
class provides a path item that you can add to aQGraphicsScene
. More…

Detailed Description¶
To set the item’s path, pass a
QPainterPath
toQGraphicsPathItem
‘s constructor, or call thesetPath()
function. Thepath()
function returns the current path.![]()
QGraphicsPathItem
uses the path to provide a reasonable implementation ofboundingRect()
,shape()
, andcontains()
. Thepaint()
function draws the path using the item’s associated pen and brush, which you can set by calling thesetPen()
andsetBrush()
functions.
-
class
QGraphicsPathItem
([parent=None])¶ QGraphicsPathItem(path[, parent=None])
- param parent
- param path
QPainterPath
Constructs a QGraphicsPath.
parent
is passed toQAbstractGraphicsShapeItem
‘s constructor.See also
Constructs a QGraphicsPath item using
path
as the default path.parent
is passed toQAbstractGraphicsShapeItem
‘s constructor.See also
-
PySide2.QtWidgets.QGraphicsPathItem.
path
()¶ - Return type
QPainterPath
Returns the item’s path as a
QPainterPath
. If no item has been set, an emptyQPainterPath
is returned.See also