内容表

上一话题

QAbstractButton

下一话题

QAbstractItemDelegate

QAbstractGraphicsShapeItem

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

Inheritance diagram of PySide2.QtWidgets.QAbstractGraphicsShapeItem

继承者: QGraphicsEllipseItem , QGraphicsPathItem , QGraphicsPolygonItem , QGraphicsRectItem , QGraphicsSimpleTextItem

概要

函数

详细描述

This class does not fully implement an item by itself; in particular, it does not implement boundingRect() and 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.

class QAbstractGraphicsShapeItem ( [ parent=None ] )
param parent

QGraphicsItem

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

PySide2.QtWidgets.QAbstractGraphicsShapeItem. brush ( )
返回类型

QBrush

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

另请参阅

setBrush()

PySide2.QtWidgets.QAbstractGraphicsShapeItem. pen ( )
返回类型

QPen

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

另请参阅

setPen()

PySide2.QtWidgets.QAbstractGraphicsShapeItem. setBrush ( brush )
参数

brush QBrush

Sets the item’s brush to 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()

PySide2.QtWidgets.QAbstractGraphicsShapeItem. setPen ( pen )
参数

pen QPen

Sets the pen for this item to pen .

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

另请参阅

pen()