QGraphicsPathItem露

The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene . More鈥�

Inheritance diagram of PySide2.QtWidgets.QGraphicsPathItem

Synopsis露

Functions露

Detailed Description露

To set the item鈥檚 path, pass a QPainterPath to QGraphicsPathItem 鈥榮 constructor, or call the setPath() function. The path() function returns the current path.

../../_images/graphicsview-pathitem.png

QGraphicsPathItem uses the path to provide a reasonable implementation of boundingRect() , shape() , and contains() . The paint() function draws the path using the item鈥檚 associated pen and brush, which you can set by calling the setPen() and setBrush() functions.

class PySide2.QtWidgets.QGraphicsPathItem([parent=None])露

PySide2.QtWidgets.QGraphicsPathItem(path[, parent=None])

param parent:

PySide2.QtWidgets.QGraphicsItem

param path:

PySide2.QtGui.QPainterPath

Constructs a QGraphicsPath. parent is passed to QAbstractGraphicsShapeItem 鈥榮 constructor.

See also

addItem()

Constructs a QGraphicsPath item using path as the default path. parent is passed to QAbstractGraphicsShapeItem 鈥榮 constructor.

See also

addItem()

PySide2.QtWidgets.QGraphicsPathItem.path()露
Return type:

PySide2.QtGui.QPainterPath

Returns the item鈥檚 path as a QPainterPath . If no item has been set, an empty QPainterPath is returned.

See also

setPath()

PySide2.QtWidgets.QGraphicsPathItem.setPath(path)露
Parameters:

path 鈥� PySide2.QtGui.QPainterPath

Sets the item鈥檚 path to be the given path .

See also

path()