|  | Home · All Classes · Modules

# QAbstractGraphicsShapeItem Class Reference
[QtGui module]

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

Inherits QGraphicsItem.

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

### Methods

- __init__ (self, QGraphicsItem parent = None, QGraphicsScene scene = None)
- QBrush brush (self)
- bool isObscuredBy (self, QGraphicsItem item)
- QPainterPath opaqueArea (self)
- QPen pen (self)
- setBrush (self, QBrush brush)
- setPen (self, QPen pen)

## Detailed Description

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() 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.

See also QGraphicsRectItem, QGraphicsEllipseItem, QGraphicsPathItem, QGraphicsPolygonItem, QGraphicsTextItem, QGraphicsLineItem, QGraphicsPixmapItem, and The Graphics View Framework.

## Method Documentation

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

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

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

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

### QBrush QAbstractGraphicsShapeItem.brush (self)

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

See also setBrush().

### bool QAbstractGraphicsShapeItem.isObscuredBy (self, QGraphicsItem item)

### QPainterPath QAbstractGraphicsShapeItem.opaqueArea (self)

### 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.

See also setPen().

### QAbstractGraphicsShapeItem.setBrush (self, QBrush brush)

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().

### QAbstractGraphicsShapeItem.setPen (self, QPen pen)

Sets the pen for this item to pen.

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

See also pen().