The PySide.QtGui.QGraphicsPolygonItem class provides a polygon item that you can add to a PySide.QtGui.QGraphicsScene .
To set the item’s polygon, pass a PySide.QtGui.QPolygonF to PySide.QtGui.QGraphicsPolygonItem ‘s constructor, or call the PySide.QtGui.QGraphicsPolygonItem.setPolygon() function. The PySide.QtGui.QGraphicsPolygonItem.polygon() function returns the current polygon.
![]()
PySide.QtGui.QGraphicsPolygonItem uses the polygon and the pen width to provide a reasonable implementation of PySide.QtGui.QGraphicsPolygonItem.boundingRect() , PySide.QtGui.QGraphicsPolygonItem.shape() , and PySide.QtGui.QGraphicsPolygonItem.contains() . The PySide.QtGui.QGraphicsPolygonItem.paint() function draws the polygon 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.
| Parameters: |
|
|---|
| Return type: | PySide.QtCore.Qt.FillRule |
|---|
Returns the fill rule of the polygon. The default fill rule is Qt.OddEvenFill .
| Return type: | PySide.QtGui.QPolygonF |
|---|
Returns the item’s polygon, or an empty polygon if no polygon has been set.
| Parameters: | rule – PySide.QtCore.Qt.FillRule |
|---|
| Parameters: | polygon – PySide.QtGui.QPolygonF |
|---|
Sets the item’s polygon to be the given polygon .