QGraphicsPathItem Class Reference

[ QtGui module]

The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene . 更多...

继承 QAbstractGraphicsShapeItem .

方法


详细描述

The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene .

要设置项的路径,传递 QPainterPath to QGraphicsPathItem's constructor, or call the setPath () 函数。 path () 函数返回 the current path.

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


方法文档编制

QGraphicsPathItem.__init__ ( self , QGraphicsItem   parent  = None, QGraphicsScene   scene  = None)

parent argument, if not None, causes self to be owned by Qt instead of PyQt.

scene argument, if not None, causes self to be owned by Qt instead of PyQt.

构造 QGraphicsPath。 parent 会被传递给 QAbstractGraphicsShapeItem 's 构造函数。

另请参阅 QGraphicsScene.addItem ().

QGraphicsPathItem.__init__ ( self , QPainterPath   path , QGraphicsItem   parent  = None, QGraphicsScene   scene  = None)

parent argument, if not None, causes self to be owned by Qt instead of PyQt.

scene argument, if not None, causes self to be owned by Qt instead of PyQt.

构造 QGraphicsPath 项使用 path as the default 路径。 parent 会被传递给 QAbstractGraphicsShapeItem 's 构造函数。

另请参阅 QGraphicsScene.addItem ().

QRectF QGraphicsPathItem.boundingRect ( self )

重实现自 QGraphicsItem.boundingRect ().

bool QGraphicsPathItem.contains ( self , QPointF   point )

重实现自 QGraphicsItem.contains ().

bool QGraphicsPathItem.isObscuredBy ( self , QGraphicsItem   item )

重实现自 QGraphicsItem.isObscuredBy ().

QPainterPath QGraphicsPathItem.opaqueArea ( self )

重实现自 QGraphicsItem.opaqueArea ().

QGraphicsPathItem.paint ( self , QPainter   painter , QStyleOptionGraphicsItem   option , QWidget   widget  = None)

重实现自 QGraphicsItem.paint ().

QPainterPath QGraphicsPathItem.path ( self )

QGraphicsPathItem.setPath ( self , QPainterPath   path )

将项的路径设为给定 path .

另请参阅 path ().

QPainterPath QGraphicsPathItem.shape ( self )

重实现自 QGraphicsItem.shape ().

int QGraphicsPathItem.type ( self )

重实现自 QGraphicsItem.type ().