QGraphicsPolygonItem Class Reference
[QtGui module]
该QGraphicsPolygonItem类提供了一个多边形的项目,你可以添加到QGraphicsScene。More…
Methods
__init__ (self, QGraphicsItem parent = None, QGraphicsScene scene = None)
__init__ (self, QPolygonF polygon, QGraphicsItem parent = None, QGraphicsScene scene = None)
QRectF boundingRect (self)
bool contains (self, QPointF point)
Qt.FillRule fillRule (self)
bool isObscuredBy (self, QGraphicsItem item)
QPainterPath opaqueArea (self)
paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget = None)
QPolygonF polygon (self)
setFillRule (self, Qt.FillRule rule)
setPolygon (self, QPolygonF polygon)
QPainterPath shape (self)
int type (self)
Detailed Description
该QGraphicsPolygonItem类提供了一个多边形的项目,你可以添加到QGraphicsScene。
要设置项目的多边形,通过一个QPolygonF到QGraphicsPolygonItem的构造函数,或致电setPolygon()函数。该polygon( )函数返回当前的多边形。
QGraphicsPolygonItem使用多边形和笔宽,以提供合理的实施boundingRect( )shape()和contains( ) 。该paint( )函数绘制使用该项目的相关的画笔和画刷多边形,你可以通过调用设置setPen()和setBrush()函数。
Method Documentation
QGraphicsPolygonItem.__init__ (self, QGraphicsItem parent = None, QGraphicsScene scene = None)
该parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
该scene的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
构造一个QGraphicsPolygonItem。parent被传递给QAbstractGraphicsShapeItem的构造。
See also QGraphicsScene.addItem( ) 。
QGraphicsPolygonItem.__init__ (self, QPolygonF polygon, QGraphicsItem parent = None, QGraphicsScene scene = None)
该parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
该scene的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
构造一个QGraphicsPolygonItem同polygon作为默认的多边形。parent被传递给QAbstractGraphicsShapeItem的构造。
See also QGraphicsScene.addItem( ) 。
QRectF QGraphicsPolygonItem.boundingRect (self)
从重新实现QGraphicsItem.boundingRect( ) 。
bool QGraphicsPolygonItem.contains (self, QPointF point)
从重新实现QGraphicsItem.contains( ) 。
Qt.FillRule QGraphicsPolygonItem.fillRule (self)
返回多边形的填充规则。默认的填充规则是Qt.OddEvenFill。
See also setFillRule( )QPainterPath.fillRule()和QPainter.drawPolygon( ) 。
bool QGraphicsPolygonItem.isObscuredBy (self, QGraphicsItem item)
从重新实现QGraphicsItem.isObscuredBy( ) 。
QPainterPath QGraphicsPolygonItem.opaqueArea (self)
从重新实现QGraphicsItem.opaqueArea( ) 。
QGraphicsPolygonItem.paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget = None)
从重新实现QGraphicsItem.paint( ) 。
QPolygonF QGraphicsPolygonItem.polygon (self)
[
返回该项目的多边形,或者一个空的多边形,如果多边形没有被设置。
]($docs-qpolygonf.html)
See also setPolygon( ) 。
QGraphicsPolygonItem.setFillRule (self, Qt.FillRule rule)
设置多边形的填充规则rule。默认的填充规则是Qt.OddEvenFill。
See also fillRule( )QPainterPath.fillRule()和QPainter.drawPolygon( ) 。
QGraphicsPolygonItem.setPolygon (self, QPolygonF polygon)
设置项的多边形也可以在给定polygon。
See also polygon( ) 。
QPainterPath QGraphicsPolygonItem.shape (self)
int QGraphicsPolygonItem.type (self)
从重新实现QGraphicsItem.type( ) 。