![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
\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) |
Public Member Functions inherited from QGradient | |
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 2192 of file qbrush.cpp.
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 2126 of file qbrush.cpp.
Constructs a simple radial gradient with the given center (cx, cy), radius and focal point (fx, fy).
Definition at line 2171 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 2146 of file qbrush.cpp.
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 2182 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 2210 of file qbrush.cpp.
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 2230 of file qbrush.cpp.
QRadialGradient::~QRadialGradient | ( | ) |
Definition at line 2246 of file qbrush.cpp.
QPointF QRadialGradient::center | ( | ) | const |
Returns the center of this radial gradient in logical coordinates.
Definition at line 2256 of file qbrush.cpp.
qreal QRadialGradient::centerRadius | ( | ) | const |
Returns the center radius of this radial gradient in logical coordinates.
Definition at line 2327 of file qbrush.cpp.
QPointF QRadialGradient::focalPoint | ( | ) | const |
Returns the focal point of this radial gradient in logical coordinates.
Definition at line 2378 of file qbrush.cpp.
qreal QRadialGradient::focalRadius | ( | ) | const |
Returns the focal radius of this radial gradient in logical coordinates.
Definition at line 2353 of file qbrush.cpp.
qreal QRadialGradient::radius | ( | ) | const |
Returns the radius of this radial gradient in logical coordinates.
Equivalent to centerRadius()
Definition at line 2298 of file qbrush.cpp.
Sets the center of this radial gradient in logical coordinates to center.
Definition at line 2282 of file qbrush.cpp.
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).
Sets the center radius of this radial gradient in logical coordinates to radius
Definition at line 2339 of file qbrush.cpp.
Sets the focal point of this radial gradient in logical coordinates to focalPoint.
Definition at line 2404 of file qbrush.cpp.
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).
Sets the focal radius of this radial gradient in logical coordinates to radius
Definition at line 2365 of file qbrush.cpp.
Sets the radius of this radial gradient in logical coordinates to radius
Equivalent to setCenterRadius()
Definition at line 2313 of file qbrush.cpp.