QAbstractGraphicsShapeItem Class Reference

[ QtGui module]

The QAbstractGraphicsShapeItem class provides a common base for all path items. 更多...

继承 QGraphicsItem .

Inherited by QGraphicsEllipseItem , QGraphicsPathItem , QGraphicsPolygonItem , QGraphicsRectItem and QGraphicsSimpleTextItem .

方法


详细描述

The QAbstractGraphicsShapeItem class provides a common base for all path items.

This class does not fully implement an item by itself; in particular, it does not implement boundingRect () 和 paint (), which are inherited by QGraphicsItem .

You can subclass this item to provide a simple base implementation of accessors for the item's pen and brush.


方法文档编制

QAbstractGraphicsShapeItem.__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.

构造 QAbstractGraphicsShapeItem . parent 会被传递给 QGraphicsItem 的构造函数。

QBrush QAbstractGraphicsShapeItem.brush ( self )

Returns the item's brush, or an empty brush if no brush has been set.

另请参阅 setBrush ().

bool QAbstractGraphicsShapeItem.isObscuredBy ( self , QGraphicsItem   item )

重实现自 QGraphicsItem.isObscuredBy ().

QPainterPath QAbstractGraphicsShapeItem.opaqueArea ( self )

重实现自 QGraphicsItem.opaqueArea ().

QPen QAbstractGraphicsShapeItem.pen ( self )

Returns the item's pen. If no pen has been set, this function returns QPen(), a default black solid line pen with 0 width.

另请参阅 setPen ().

QAbstractGraphicsShapeItem.setBrush ( self , QBrush   brush )

把项笔刷设为 brush .

The item's brush is used to fill the item.

If you use a brush with a QGradient , the gradient is relative to the item's coordinate system.

另请参阅 brush ().

QAbstractGraphicsShapeItem.setPen ( self , QPen   pen )

Sets the pen for this item to pen .

The pen is used to draw the item's outline.

另请参阅 pen ().