QGraphicsPolygonItemclass provides a polygon item that you can add to aQGraphicsScene. 更多 …
def
fillRule
()
def
polygon
()
def
setFillRule
(rule)
def
setPolygon
(polygon)
To set the item’s polygon, pass a
QPolygonFtoQGraphicsPolygonItem‘s constructor, or call thesetPolygon()function. Thepolygon()function returns the current polygon.![]()
QGraphicsPolygonItemuses the polygon and the pen width to provide a reasonable implementation ofboundingRect(),shape(),和contains()。paint()function draws the polygon using the item’s associated pen and brush, which you can set by calling thesetPen()andsetBrush()函数。
QGraphicsPolygonItem
(
[
parent=None
]
)
¶
QGraphicsPolygonItem(polygon[, parent=None])
- param parent
- param polygon
QPolygonF
构造
QGraphicsPolygonItem
.
parent
会被传递给
QAbstractGraphicsShapeItem
‘s constructor.
另请参阅
构造
QGraphicsPolygonItem
with
polygon
as the default polygon.
parent
会被传递给
QAbstractGraphicsShapeItem
‘s constructor.
另请参阅
PySide2.QtWidgets.QGraphicsPolygonItem.
fillRule
(
)
¶
FillRule
Returns the fill rule of the polygon. The default fill rule is
OddEvenFill
.
另请参阅
setFillRule()
fillRule()
drawPolygon()
PySide2.QtWidgets.QGraphicsPolygonItem.
polygon
(
)
¶
QPolygonF
Returns the item’s polygon, or an empty polygon if no polygon has been set.
另请参阅
PySide2.QtWidgets.QGraphicsPolygonItem.
setFillRule
(
rule
)
¶
rule
–
FillRule
Sets the fill rule of the polygon to
rule
. The default fill rule is
OddEvenFill
.
另请参阅
fillRule()
fillRule()
drawPolygon()