QGraphicsEllipseItem

Inheritance diagram of PySide2.QtWidgets.QGraphicsEllipseItem

Synopsis

Functions

Detailed Description

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

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

graphicsview-ellipseitem1 graphicsview-ellipseitem-pie2

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

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

class PySide2.QtWidgets.QGraphicsEllipseItem([parent=nullptr])
class PySide2.QtWidgets.QGraphicsEllipseItem(rect[, parent=nullptr])
class PySide2.QtWidgets.QGraphicsEllipseItem(x, y, w, h[, parent=nullptr])
Parameters:

Constructs a PySide2.QtWidgets.QGraphicsEllipseItem . parent is passed to PySide2.QtWidgets.QAbstractGraphicsShapeItem ‘s constructor.

Constructs a PySide2.QtWidgets.QGraphicsEllipseItem using rect as the default rectangle. parent is passed to PySide2.QtWidgets.QAbstractGraphicsShapeItem ‘s constructor.

Constructs a PySide2.QtWidgets.QGraphicsEllipseItem using the rectangle defined by (x , y ) and the given width and height , as the default rectangle. parent is passed to PySide2.QtWidgets.QAbstractGraphicsShapeItem ‘s constructor.

PySide2.QtWidgets.QGraphicsEllipseItem.rect()
Return type:PySide2.QtCore.QRectF

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

See also

PySide2.QtWidgets.QGraphicsEllipseItem.setRect() QPainter.drawEllipse()

PySide2.QtWidgets.QGraphicsEllipseItem.setRect(x, y, w, h)
Parameters:
  • xPySide2.QtCore.qreal
  • yPySide2.QtCore.qreal
  • wPySide2.QtCore.qreal
  • hPySide2.QtCore.qreal
PySide2.QtWidgets.QGraphicsEllipseItem.setRect(rect)
Parameters:rectPySide2.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.

See also

PySide2.QtWidgets.QGraphicsEllipseItem.rect() QPainter.drawEllipse()

PySide2.QtWidgets.QGraphicsEllipseItem.setSpanAngle(angle)
Parameters:anglePySide2.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 PySide2.QtWidgets.QGraphicsEllipseItem.startAngle() to represent an ellipse segment (a pie). By default, the span angle is 5760 (360 * 16, a full ellipse).

PySide2.QtWidgets.QGraphicsEllipseItem.setStartAngle(angle)
Parameters:anglePySide2.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 PySide2.QtWidgets.QGraphicsEllipseItem.spanAngle() for representing an ellipse segment (a pie). By default, the start angle is 0.

PySide2.QtWidgets.QGraphicsEllipseItem.spanAngle()
Return type:PySide2.QtCore.int

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

PySide2.QtWidgets.QGraphicsEllipseItem.startAngle()
Return type:PySide2.QtCore.int

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