内容表

上一话题

QGraphicsPixmapItem

下一话题

QGraphicsProxyWidget

QGraphicsPolygonItem

QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene . 更多

Inheritance diagram of PySide2.QtWidgets.QGraphicsPolygonItem

概要

函数

详细描述

To set the item’s polygon, pass a QPolygonF to QGraphicsPolygonItem ‘s constructor, or call the setPolygon() function. The polygon() function returns the current polygon.

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

QGraphicsPolygonItem uses the polygon and the pen width to provide a reasonable implementation of boundingRect() , shape() ,和 contains() paint() function draws the polygon using the item’s associated pen and brush, which you can set by calling the setPen() and setBrush() 函数。

class QGraphicsPolygonItem ( [ parent=None ] )

QGraphicsPolygonItem(polygon[, parent=None])

param parent

QGraphicsItem

param polygon

QPolygonF

构造 QGraphicsPolygonItem . parent 会被传递给 QAbstractGraphicsShapeItem ‘s constructor.

另请参阅

addItem()

构造 QGraphicsPolygonItem with polygon as the default polygon. parent 会被传递给 QAbstractGraphicsShapeItem ‘s constructor.

另请参阅

addItem()

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.

另请参阅

setPolygon()

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()

PySide2.QtWidgets.QGraphicsPolygonItem. setPolygon ( polygon )
参数

polygon QPolygonF

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

另请参阅

polygon()