|  | Home · All Classes · Modules

# QGraphicsEllipseItem Class Reference
[QtGui module]

The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene. More...

Inherits QAbstractGraphicsShapeItem.

### Methods

- __init__ (self, QGraphicsItem parent = None, QGraphicsScene scene = None)
- __init__ (self, QRectF, QGraphicsItem parent = None, QGraphicsScene scene = None)
- __init__ (self, float, float, float, float, QGraphicsItem parent = None, QGraphicsScene scene = None)
- QRectF boundingRect (self)
- bool contains (self, QPointF)
- bool isObscuredBy (self, QGraphicsItem)
- QPainterPath opaqueArea (self)
- paint (self, QPainter, QStyleOptionGraphicsItem, QWidget widget = None)
- QRectF rect (self)
- setRect (self, QRectF)
- setRect (self, float, float, float, float)
- setSpanAngle (self, int)
- setStartAngle (self, int)
- QPainterPath shape (self)
- int spanAngle (self)
- int startAngle (self)
- int type (self)

## Detailed Description

The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.

QGraphicsEllipseItem respresents an ellipse with a fill and an outline, and you can also use it for ellipse segments (see startAngle(), spanAngle()).

To set the item's ellipse, pass a QRectF to QGraphicsEllipseItem's constructor, or call setRect(). The rect() function returns the current ellipse geometry.

QGraphicsEllipseItem uses the rect and the pen width to provide a reasonable implementation of boundingRect(), shape(), and contains(). The paint() function draws the ellipse using the item's associated pen and brush, which you can set by calling setPen() and setBrush().

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

## Method Documentation

### QGraphicsEllipseItem.__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 QGraphicsEllipseItem. parent is passed to QAbstractGraphicsShapeItem's constructor.

See also QGraphicsScene.addItem().

### QGraphicsEllipseItem.__init__ (self, QRectF, 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 QGraphicsEllipseItem using rect as the default rectangle. parent is passed to QAbstractGraphicsShapeItem's constructor.

See also QGraphicsScene.addItem().

### QGraphicsEllipseItem.__init__ (self, float, float, float, float, 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 QGraphicsEllipseItem using the rectangle defined by (x, y) and the given width and height, as the default rectangle. parent is passed to QAbstractGraphicsShapeItem's constructor.

This function was introduced in Qt 4.3.

See also QGraphicsScene.addItem().

### QRectF QGraphicsEllipseItem.boundingRect (self)

Reimplemented from QGraphicsItem.boundingRect().

### bool QGraphicsEllipseItem.contains (self, QPointF)

Reimplemented from QGraphicsItem.contains().

### bool QGraphicsEllipseItem.isObscuredBy (self, QGraphicsItem)

Reimplemented from QGraphicsItem.isObscuredBy().

### QPainterPath QGraphicsEllipseItem.opaqueArea (self)

Reimplemented from QGraphicsItem.opaqueArea().

### QGraphicsEllipseItem.paint (self, QPainter, QStyleOptionGraphicsItem, QWidget widget = None)

Reimplemented from QGraphicsItem.paint().

### QRectF QGraphicsEllipseItem.rect (self)

Returns the item's ellipse geometry as a QRectF.

See also setRect() and QPainter.drawEllipse().

### QGraphicsEllipseItem.setRect (self, QRectF)

Sets the item's ellipse geometry to rect. The rectangle's left edge defines the left edge of the ellipse, and the rectangle's top edge describes the top of the ellipse. The height and width of the rectangle describe the height and width of the ellipse.

See also rect() and QPainter.drawEllipse().

### QGraphicsEllipseItem.setRect (self, float, float, float, float)

Sets the item's rectangle to the rectangle defined by (x, y) and the given width and height.

This convenience function is equivalent to calling `setRect(QRectF(x, y, width, height))`

See also rect().

### QGraphicsEllipseItem.setSpanAngle (self, int)

Sets the span angle for an ellipse segment to angle, which is in 16ths of a degree. This angle is used together with startAngle() to represent an ellipse segment (a pie). By default, the span angle is 5760 (360 * 16, a full ellipse).

See also spanAngle(), setStartAngle(), and QPainter.drawPie().

### QGraphicsEllipseItem.setStartAngle (self, int)

Sets the start angle for an ellipse segment to angle, which is in 16ths of a degree. This angle is used together with spanAngle() for representing an ellipse segment (a pie). By default, the start angle is 0.

See also startAngle(), setSpanAngle(), and QPainter.drawPie().

### QPainterPath QGraphicsEllipseItem.shape (self)

Reimplemented from QGraphicsItem.shape().

### int QGraphicsEllipseItem.spanAngle (self)

Returns the span angle of an ellipse segment in 16ths of a degree. This angle is used together with startAngle() for representing an ellipse segment (a pie). By default, this function returns 5760 (360 * 16, a full ellipse).

See also setSpanAngle() and startAngle().

### int QGraphicsEllipseItem.startAngle (self)

Returns the start angle for an ellipse segment in 16ths of a degree. This angle is used together with spanAngle() for representing an ellipse segment (a pie). By default, the start angle is 0.

See also setStartAngle() and spanAngle().

### int QGraphicsEllipseItem.type (self)

Reimplemented from QGraphicsItem.type().