6.0.0-rc4Source

QLinearGradient Class

The QLinearGradient class changes color along a line. More…

Header#include <QLinearGradient>
CMaketarget_link_libraries(app PRIVATE Nt::Gui)
ModuleNt GUI C++ Classes
InheritsQGradient

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)
QPointFstart() const
voidsetStart(const QPointF &start)
voidsetStart(qreal x, qreal y)
QPointFfinalStop() const
voidsetFinalStop(const QPointF &stop)
voidsetFinalStop(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.