QGraphicsEllipseItem

Synopsis

Functions

Detailed Description

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

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

../../_images/graphicsview-ellipseitem.png ../../_images/graphicsview-ellipseitem-pie.png

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

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

class PySide.QtGui.QGraphicsEllipseItem([parent=None[, scene=None]])
class PySide.QtGui.QGraphicsEllipseItem(rect[, parent=None[, scene=None]])
class PySide.QtGui.QGraphicsEllipseItem(x, y, w, h[, parent=None[, scene=None]])
Parameters:
PySide.QtGui.QGraphicsEllipseItem.rect()
Return type:PySide.QtCore.QRectF

Returns the item’s ellipse geometry as a PySide.QtCore.QRectF .

PySide.QtGui.QGraphicsEllipseItem.setRect(rect)
Parameters:rectPySide.QtCore.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.

PySide.QtGui.QGraphicsEllipseItem.setRect(x, y, w, h)
Parameters:
  • xPySide.QtCore.qreal
  • yPySide.QtCore.qreal
  • wPySide.QtCore.qreal
  • hPySide.QtCore.qreal

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

PySide.QtGui.QGraphicsEllipseItem.setSpanAngle(angle)
Parameters:anglePySide.QtCore.int

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

PySide.QtGui.QGraphicsEllipseItem.setStartAngle(angle)
Parameters:anglePySide.QtCore.int

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

PySide.QtGui.QGraphicsEllipseItem.spanAngle()
Return type:PySide.QtCore.int

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

PySide.QtGui.QGraphicsEllipseItem.startAngle()
Return type:PySide.QtCore.int

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