QCConicalGradient Class
QCConicalGradient is a brush for conical gradient painting. More...
| Header: | #include <QCConicalGradient> |
| Inherits: | QCGradient |
Public Functions
| QCConicalGradient() | |
| QCConicalGradient(QPointF center, float startAngle) | |
| QCConicalGradient(float centerX, float centerY, float startAngle) | |
| float | angle() const |
| QPointF | centerPosition() const |
| void | setAngle(float angle) |
| void | setCenterPosition(QPointF center) |
| void | setCenterPosition(float x, float y) |
Detailed Description
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:
QCConicalGradient cg(200, 200, 0); cg.setStartColor(Qt::blue); cg.setEndColor(Qt::darkYellow); painter.setFillStyle(cg); painter.fillRect(100, 100, 200, 200);

Member Function Documentation
QCConicalGradient::QCConicalGradient()
Constructs a default conical gradient. Gradient center position is (0, 0). Gradient angle is 0.0. Gradient start color is white (255, 255, 255) and end color transparent black (0, 0, 0, 0).
QCConicalGradient::QCConicalGradient(QPointF center, float startAngle)
Constructs a conical gradient. Gradient center position is center. Gradient start angle is startAngle. Gradient start color is white (255, 255, 255) and end color transparent black (0, 0, 0, 0).
QCConicalGradient::QCConicalGradient(float centerX, float centerY, float startAngle)
Constructs a conical gradient. Gradient center position is ( centerX, centerY). Gradient start angle is startAngle. Gradient start color is white (255, 255, 255) and end color transparent black (0, 0, 0, 0).
float QCConicalGradient::angle() const
Returns the start angle of conical gradient in radians.
See also setAngle().
QPointF QCConicalGradient::centerPosition() const
Returns the center point of conical gradient.
See also setCenterPosition().
void QCConicalGradient::setAngle(float angle)
Sets the start angle of conical gradient to angle in radians. The angle starts from a line going horizontally right from the center, and proceeds clockwise.
See also angle().
void QCConicalGradient::setCenterPosition(QPointF center)
Sets the center point of conical gradient to center.
See also centerPosition().
void QCConicalGradient::setCenterPosition(float x, float y)
Sets the center point of conical gradient to ( x, y).
© 2025 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.