QGraphicsEllipseItem¶
The
QGraphicsEllipseItem
class provides an ellipse item that you can add to aQGraphicsScene
. More…
Synopsis¶
Functions¶
def
rect
()def
setRect
(rect)def
setRect
(x, y, w, h)def
setSpanAngle
(angle)def
setStartAngle
(angle)def
spanAngle
()def
startAngle
()
Detailed Description¶
QGraphicsEllipseItem
respresents an ellipse with a fill and an outline, and you can also use it for ellipse segments (seestartAngle()
,spanAngle()
).
To set the item’s ellipse, pass a
QRectF
toQGraphicsEllipseItem
‘s constructor, or callsetRect()
. Therect()
function returns the current ellipse geometry.
QGraphicsEllipseItem
uses the rect and the pen width to provide a reasonable implementation ofboundingRect()
,shape()
, andcontains()
. Thepaint()
function draws the ellipse using the item’s associated pen and brush, which you can set by callingsetPen()
andsetBrush()
.
- class PySide2.QtWidgets.QGraphicsEllipseItem([parent=None])¶
PySide2.QtWidgets.QGraphicsEllipseItem(rect[, parent=None])
PySide2.QtWidgets.QGraphicsEllipseItem(x, y, w, h[, parent=None])
- param w:
float
- param parent:
- param x:
float
- param y:
float
- param h:
float
- param rect:
Constructs a
QGraphicsEllipseItem
.parent
is passed toQAbstractGraphicsShapeItem
‘s constructor.See also
Constructs a
QGraphicsEllipseItem
usingrect
as the default rectangle.parent
is passed toQAbstractGraphicsShapeItem
‘s constructor.See also
Constructs a
QGraphicsEllipseItem
using the rectangle defined by (x
,y
) and the givenwidth
andheight
, as the default rectangle.parent
is passed toQAbstractGraphicsShapeItem
‘s constructor.See also
- PySide2.QtWidgets.QGraphicsEllipseItem.rect()¶
- Return type:
Returns the item’s ellipse geometry as a
QRectF
.See also
setRect()
drawEllipse()
- PySide2.QtWidgets.QGraphicsEllipseItem.setRect(rect)¶
- Parameters:
rect –
PySide2.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
rect()
drawEllipse()
- PySide2.QtWidgets.QGraphicsEllipseItem.setRect(x, y, w, h)
- Parameters:
x – float
y – float
w – float
h – float
- PySide2.QtWidgets.QGraphicsEllipseItem.setSpanAngle(angle)¶
- Parameters:
angle – int
Sets the span angle for an ellipse segment to
angle
, which is in 16ths of a degree. This angle is used together withstartAngle()
to represent an ellipse segment (a pie). By default, the span angle is 5760 (360 * 16, a full ellipse).See also
spanAngle()
setStartAngle()
drawPie()
- PySide2.QtWidgets.QGraphicsEllipseItem.setStartAngle(angle)¶
- Parameters:
angle – int
Sets the start angle for an ellipse segment to
angle
, which is in 16ths of a degree. This angle is used together withspanAngle()
for representing an ellipse segment (a pie). By default, the start angle is 0.See also
startAngle()
setSpanAngle()
drawPie()
- PySide2.QtWidgets.QGraphicsEllipseItem.spanAngle()¶
- Return type:
int
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
- PySide2.QtWidgets.QGraphicsEllipseItem.startAngle()¶
- Return type:
int
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
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.