![]() |
Qt 6.x
The Qt SDK
|
\inmodule QtGui More...
#include <qbrush.h>
Public Member Functions | |
QRadialGradient () | |
Constructs a simple radial gradient with the center and focal point at (0, 0) with a radius of 1. | |
QRadialGradient (const QPointF ¢er, qreal radius, const QPointF &focalPoint) | |
Constructs a simple radial gradient with the given center, radius and focalPoint. | |
QRadialGradient (qreal cx, qreal cy, qreal radius, qreal fx, qreal fy) | |
Constructs a simple radial gradient with the given center (cx, cy), radius and focal point (fx, fy). | |
QRadialGradient (const QPointF ¢er, qreal radius) | |
Constructs a simple radial gradient with the given center, radius and the focal point in the circle center. | |
QRadialGradient (qreal cx, qreal cy, qreal radius) | |
Constructs a simple radial gradient with the center at (cx, cy) and the specified radius. | |
QRadialGradient (const QPointF ¢er, qreal centerRadius, const QPointF &focalPoint, qreal focalRadius) | |
QRadialGradient (qreal cx, qreal cy, qreal centerRadius, qreal fx, qreal fy, qreal focalRadius) | |
~QRadialGradient () | |
QPointF | center () const |
Returns the center of this radial gradient in logical coordinates. | |
void | setCenter (const QPointF ¢er) |
void | setCenter (qreal x, qreal y) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QPointF | focalPoint () const |
Returns the focal point of this radial gradient in logical coordinates. | |
void | setFocalPoint (const QPointF &focalPoint) |
void | setFocalPoint (qreal x, qreal y) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
qreal | radius () const |
Returns the radius of this radial gradient in logical coordinates. | |
void | setRadius (qreal radius) |
qreal | centerRadius () const |
void | setCenterRadius (qreal radius) |
qreal | focalRadius () const |
void | setFocalRadius (qreal radius) |
![]() | |
QGradient () | |
QGradient (Preset) | |
~QGradient () | |
Type | type () const |
Returns the type of gradient. | |
void | setSpread (Spread spread) |
Specifies the spread method that should be used for this gradient. | |
Spread | spread () const |
Returns the spread method use by this gradient. | |
void | setColorAt (qreal pos, const QColor &color) |
Creates a stop point at the given position with the given color. | |
void | setStops (const QGradientStops &stops) |
Replaces the current set of stop points with the given stopPoints. | |
QGradientStops | stops () const |
Returns the stop points for this gradient. | |
CoordinateMode | coordinateMode () const |
void | setCoordinateMode (CoordinateMode mode) |
InterpolationMode | interpolationMode () const |
void | setInterpolationMode (InterpolationMode mode) |
bool | operator== (const QGradient &gradient) const |
Returns true if the gradient is the same as the other gradient specified; otherwise returns false . | |
bool | operator!= (const QGradient &other) const |
\inmodule QtGui
The QRadialGradient class is used in combination with QBrush to specify a radial gradient brush.
Qt supports both simple and extended radial gradients.
Simple radial gradients interpolate colors between a focal point and end points on a circle surrounding it. Extended radial gradients interpolate colors between a focal circle and a center circle. Points outside the cone defined by the two circles will be transparent. For simple radial gradients the focal point is adjusted to lie inside the center circle, whereas the focal point can have any position in an extended radial gradient.
Outside the end points the gradient is either padded, reflected or repeated depending on the currently set \l {QGradient::Spread}{spread} method:
\table \row
The colors in a gradient is defined using stop points of the QGradientStop type, i.e. a position and a color. Use the QGradient::setColorAt() or the QGradient::setStops() function to define the stop points. It is the gradient's complete set of stop points that describes how the gradient area should be filled. If no stop points have been specified, a gradient of black at 0 to white at 1 is used.
In addition to the functions inherited from QGradient, the QRadialGradient class provides the center(), focalPoint() and radius() functions returning the gradient's center, focal point and radius respectively.
QRadialGradient::QRadialGradient | ( | ) |
Constructs a simple radial gradient with the center and focal point at (0, 0) with a radius of 1.
Definition at line 2091 of file qbrush.cpp.
References m_data, QGradient::PadSpread, and QGradient::RadialGradient.
QRadialGradient::QRadialGradient | ( | const QPointF & | center, |
qreal | radius, | ||
const QPointF & | focalPoint | ||
) |
Constructs a simple radial gradient with the given center, radius and focalPoint.
Definition at line 2025 of file qbrush.cpp.
References center(), m_data, QGradient::PadSpread, qt_radial_gradient_adapt_focal_point(), QGradient::RadialGradient, radius(), QPointF::x(), and QPointF::y().
Constructs a simple radial gradient with the given center (cx, cy), radius and focal point (fx, fy).
Definition at line 2070 of file qbrush.cpp.
Constructs a simple radial gradient with the given center, radius and the focal point in the circle center.
Definition at line 2045 of file qbrush.cpp.
References center(), m_data, QGradient::PadSpread, QGradient::RadialGradient, radius(), QPointF::x(), and QPointF::y().
Constructs a simple radial gradient with the center at (cx, cy) and the specified radius.
The focal point lies at the center of the circle.
Definition at line 2081 of file qbrush.cpp.
QRadialGradient::QRadialGradient | ( | const QPointF & | center, |
qreal | centerRadius, | ||
const QPointF & | focalPoint, | ||
qreal | focalRadius | ||
) |
Constructs an extended radial gradient with the given center, centerRadius, focalPoint, and focalRadius.
Definition at line 2109 of file qbrush.cpp.
References center(), centerRadius(), focalRadius(), m_data, QGradient::PadSpread, QGradient::RadialGradient, setFocalRadius(), QPointF::x(), and QPointF::y().
QRadialGradient::QRadialGradient | ( | qreal | cx, |
qreal | cy, | ||
qreal | centerRadius, | ||
qreal | fx, | ||
qreal | fy, | ||
qreal | focalRadius | ||
) |
Constructs an extended radial gradient with the given center (cx, cy), center radius, centerRadius, focal point, (fx, fy), and focal radius focalRadius.
Definition at line 2130 of file qbrush.cpp.
References centerRadius(), focalRadius(), m_data, QGradient::PadSpread, QGradient::RadialGradient, and setFocalRadius().
QRadialGradient::~QRadialGradient | ( | ) |
Definition at line 2147 of file qbrush.cpp.
QPointF QRadialGradient::center | ( | ) | const |
Returns the center of this radial gradient in logical coordinates.
Definition at line 2157 of file qbrush.cpp.
References m_data, Q_ASSERT, and QGradient::RadialGradient.
Referenced by QRadialGradient(), QRadialGradient(), QRadialGradient(), qt_isExtendedRadialGradient(), QSvgPaintEngine::saveRadialGradientBrush(), setCenter(), and QCoreGraphicsPaintEnginePrivate::setFillBrush().
qreal QRadialGradient::centerRadius | ( | ) | const |
Returns the center radius of this radial gradient in logical coordinates.
Definition at line 2228 of file qbrush.cpp.
References m_data, Q_ASSERT, and QGradient::RadialGradient.
Referenced by QRadialGradient(), and QRadialGradient().
QPointF QRadialGradient::focalPoint | ( | ) | const |
Returns the focal point of this radial gradient in logical coordinates.
Definition at line 2279 of file qbrush.cpp.
References m_data, Q_ASSERT, and QGradient::RadialGradient.
Referenced by qt_isExtendedRadialGradient(), QSvgPaintEngine::saveRadialGradientBrush(), and QCoreGraphicsPaintEnginePrivate::setFillBrush().
qreal QRadialGradient::focalRadius | ( | ) | const |
Returns the focal radius of this radial gradient in logical coordinates.
Definition at line 2254 of file qbrush.cpp.
References m_data, Q_ASSERT, and QGradient::RadialGradient.
Referenced by QRadialGradient(), QRadialGradient(), qt_isExtendedRadialGradient(), and QCoreGraphicsPaintEnginePrivate::setFillBrush().
qreal QRadialGradient::radius | ( | ) | const |
Returns the radius of this radial gradient in logical coordinates.
Equivalent to centerRadius()
Definition at line 2199 of file qbrush.cpp.
References m_data, Q_ASSERT, and QGradient::RadialGradient.
Referenced by QRadialGradient(), QRadialGradient(), qt_isExtendedRadialGradient(), QSvgPaintEngine::saveRadialGradientBrush(), setCenterRadius(), QCoreGraphicsPaintEnginePrivate::setFillBrush(), setFocalRadius(), and setRadius().
Sets the center of this radial gradient in logical coordinates to center.
Definition at line 2183 of file qbrush.cpp.
References center(), m_data, Q_ASSERT, QGradient::RadialGradient, QPointF::x(), and QPointF::y().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Sets the center of this radial gradient in logical coordinates to (x, y).
Definition at line 428 of file qbrush.h.
References setCenter().
Referenced by setCenter().
Sets the center radius of this radial gradient in logical coordinates to radius
Definition at line 2240 of file qbrush.cpp.
References m_data, Q_ASSERT, QGradient::RadialGradient, and radius().
Sets the focal point of this radial gradient in logical coordinates to focalPoint.
Definition at line 2305 of file qbrush.cpp.
References m_data, Q_ASSERT, and QGradient::RadialGradient.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Sets the focal point of this radial gradient in logical coordinates to (x, y).
Definition at line 432 of file qbrush.h.
References setFocalPoint().
Referenced by setFocalPoint().
Sets the focal radius of this radial gradient in logical coordinates to radius
Definition at line 2266 of file qbrush.cpp.
References m_data, Q_ASSERT, QGradient::RadialGradient, and radius().
Referenced by QRadialGradient(), QRadialGradient(), and QBrush::operator>>().
Sets the radius of this radial gradient in logical coordinates to radius
Equivalent to setCenterRadius()
Definition at line 2214 of file qbrush.cpp.
References m_data, Q_ASSERT, QGradient::RadialGradient, and radius().