PySide6.QtCanvasPainter.QCanvasConicalGradient¶
- class QCanvasConicalGradient¶
QCanvasConicalGradientis a brush for conical gradient painting.Details
Conical gradient interpolate colors between start and end points around a point with given coordinates. The angle starts from a line going horizontally right from the center, and proceeds clockwise.
Here is a simple example:

QRectF rect(20, 20, 160, 160); QCanvasConicalGradient cg(rect.center(), 1.75 * M_PI); cg.setColorAt(0.0, "#fdbb2d"); cg.setColorAt(0.5, "#1a2a6c"); cg.setColorAt(1.0, "#fdbb2d"); p->setFillStyle(cg); p->beginPath(); p->ellipse(rect); p->fill();
Synopsis¶
Methods¶
def
__init__()def
centerPosition()def
setStartAngle()def
startAngle()def
swap()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__()¶
Constructs a default conical gradient. Gradient center position is (0, 0). Gradient angle is 0.0.
- __init__(arg__1)
- Parameters:
arg__1 –
QCanvasConicalGradient
Copy-constructs an instance of
QCanvasConicalGradient.- __init__(center, startAngle)
- Parameters:
center –
QPointFstartAngle – float
Constructs a conical gradient. Gradient center position is
center. Gradient start angle isstartAngle.- __init__(centerX, centerY, startAngle)
- Parameters:
centerX – float
centerY – float
startAngle – float
Constructs a conical gradient. Gradient center position is (
centerX,centerY). Gradient start angle isstartAngle.Returns the center point of conical gradient.
See also
Sets the center point of conical gradient to
center.- setCenterPosition(x, y)
- Parameters:
x – float
y – float
Sets the center point of conical gradient to (
x,y).See also
- setStartAngle(angle)¶
- Parameters:
angle – float
Sets the start angle of conical gradient to
anglein radians. The angle starts from a line going horizontally right from the center, and proceeds clockwise.See also
- startAngle()¶
- Return type:
float
Returns the start angle of conical gradient in radians.
See also
- swap(other)¶
- Parameters:
other –
QCanvasConicalGradient
Swaps this gradient with
other. This operation is very fast and never fails.