QGraphicsPolygonItem

Inheritance diagram of QGraphicsPolygonItem

Synopsis

Functions

Detailed Description

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.

../../_images/graphicsview-polygonitem.png

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.

class PySide.QtGui.QGraphicsPolygonItem([parent=None[, scene=None]])
class PySide.QtGui.QGraphicsPolygonItem(polygon[, parent=None[, scene=None]])
Parameters:
PySide.QtGui.QGraphicsPolygonItem.fillRule()
Return type:PySide.QtCore.Qt.FillRule

Returns the fill rule of the polygon. The default fill rule is Qt.OddEvenFill .

PySide.QtGui.QGraphicsPolygonItem.polygon()
Return type:PySide.QtGui.QPolygonF

Returns the item’s polygon, or an empty polygon if no polygon has been set.

PySide.QtGui.QGraphicsPolygonItem.setFillRule(rule)
Parameters:rulePySide.QtCore.Qt.FillRule
PySide.QtGui.QGraphicsPolygonItem.setPolygon(polygon)
Parameters:polygonPySide.QtGui.QPolygonF

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