Table Of Contents

Previous topic

QGraphicsRectItem

Next topic

QPainter

QGraphicsPathItem

Inheritance diagram of QGraphicsPathItem

Synopsis

Functions

Detailed Description

The PySide.QtGui.QGraphicsPathItem class provides a path item that you can add to a PySide.QtGui.QGraphicsScene .

To set the item’s path, pass a PySide.QtGui.QPainterPath to PySide.QtGui.QGraphicsPathItem ‘s constructor, or call the PySide.QtGui.QGraphicsPathItem.setPath() function. The PySide.QtGui.QGraphicsPathItem.path() function returns the current path.

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

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

class PySide.QtGui.QGraphicsPathItem([parent=None[, scene=None]])
class PySide.QtGui.QGraphicsPathItem(path[, parent=None[, scene=None]])
Parameters:
PySide.QtGui.QGraphicsPathItem.path()
Return type:PySide.QtGui.QPainterPath

Returns the item’s path as a PySide.QtGui.QPainterPath . If no item has been set, an empty PySide.QtGui.QPainterPath is returned.

PySide.QtGui.QGraphicsPathItem.setPath(path)
Parameters:pathPySide.QtGui.QPainterPath

Sets the item’s path to be the given path .