QLinearGradient Class
The QLinearGradient class changes color along a line. More…
| Header | #include <QLinearGradient> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Gui) |
| Module | Nt GUI C++ Classes |
| Inherits | QGradient |
List of all members, including inherited members
Public Functions
| QLinearGradient() | |
| QLinearGradient(const QPointF &start, const QPointF &finalStop) | |
| QLinearGradient(qreal x1, qreal y1, qreal x2, qreal y2) | |
| QPointF | start() const |
| void | setStart(const QPointF &start) |
| void | setStart(qreal x, qreal y) |
| QPointF | finalStop() const |
| void | setFinalStop(const QPointF &stop) |
| void | setFinalStop(qreal x, qreal y) |
Detailed Description
The colors are constant along lines perpendicular to the one from start() to finalStop().
See also QGradient.
Differences from Qt
See QGradient.
Member Function Documentation
QLinearGradient::QLinearGradient()
Constructs a gradient from (0, 0) to (1, 1).
QLinearGradient::QLinearGradient(const QPointF &start, const QPointF &finalStop)
Constructs a gradient from start to finalStop.
QLinearGradient::QLinearGradient(qreal x1, qreal y1, qreal x2, qreal y2)
Constructs a gradient from (x1, y1) to (x2, y2).
QPointF QLinearGradient::finalStop() const
Returns where the gradient ends.
void QLinearGradient::setFinalStop(const QPointF &stop)
Sets where the gradient ends to stop.
void QLinearGradient::setFinalStop(qreal x, qreal y)
This is an overloaded function.
Sets where the gradient ends to (x, y).
void QLinearGradient::setStart(const QPointF &start)
Sets where the gradient starts to start.
void QLinearGradient::setStart(qreal x, qreal y)
This is an overloaded function.
Sets where the gradient starts to (x, y).
QPointF QLinearGradient::start() const
Returns where the gradient starts.