QAbstractGraphicsShapeItem

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

Inheritance diagram of PySide2.QtWidgets.QAbstractGraphicsShapeItem

Inherited by: QGraphicsEllipseItem, QGraphicsPathItem, QGraphicsPolygonItem, QGraphicsRectItem, QGraphicsSimpleTextItem

Synopsis

Functions

Detailed Description

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 PySide2.QtWidgets.QAbstractGraphicsShapeItem([parent=None])

Constructs a QAbstractGraphicsShapeItem . parent is passed to QGraphicsItem ‘s constructor.

PySide2.QtWidgets.QAbstractGraphicsShapeItem.brush()
Return type:

PySide2.QtGui.QBrush

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

See also

setBrush()

PySide2.QtWidgets.QAbstractGraphicsShapeItem.pen()
Return type:

PySide2.QtGui.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.

See also

setPen()

PySide2.QtWidgets.QAbstractGraphicsShapeItem.setBrush(brush)
Parameters:

brushPySide2.QtGui.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.

See also

brush()

PySide2.QtWidgets.QAbstractGraphicsShapeItem.setPen(pen)
Parameters:

penPySide2.QtGui.QPen

Sets the pen for this item to pen .

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

See also

pen()