KGradientSelector Class
Allows the user to choose from a one-dimensional range of colors which is given as a gradient between two colors provided by the programmer. More...
Header: | #include <KGradientSelector> |
CMake: | find_package(KF6 REQUIRED COMPONENTS WidgetsAddons) target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons) |
Inherits: | KSelector |
Properties
- firstColor : QColor
- firstText : QString
- secondColor : QColor
- secondText : QString
Public Functions
KGradientSelector(QWidget *parent = nullptr) | |
KGradientSelector(Qt::Orientation o, QWidget *parent = nullptr) | |
QColor | firstColor() const |
QString | firstText() const |
QColor | secondColor() const |
QString | secondText() const |
void | setColors(const QColor &col1, const QColor &col2) |
void | setFirstColor(const QColor &col) |
void | setFirstText(const QString &t) |
void | setSecondColor(const QColor &col) |
void | setSecondText(const QString &t) |
(since 4.5) void | setStops(const QGradientStops &stops) |
void | setText(const QString &t1, const QString &t2) |
(since 4.5) QGradientStops | stops() const |
Protected Functions
virtual QSize | minimumSize() const |
Detailed Description
Property Documentation
firstColor : QColor
Access functions:
QColor | firstColor() const |
void | setFirstColor(const QColor &col) |
firstText : QString
Access functions:
QString | firstText() const |
void | setFirstText(const QString &t) |
secondColor : QColor
Access functions:
QColor | secondColor() const |
void | setSecondColor(const QColor &col) |
secondText : QString
Access functions:
QString | secondText() const |
void | setSecondText(const QString &t) |
Member Function Documentation
[explicit]
KGradientSelector::KGradientSelector(QWidget *parent = nullptr)
Constructs a horizontal color selector which contains a gradient between white and black.
[explicit]
KGradientSelector::KGradientSelector(Qt::Orientation o, QWidget *parent = nullptr)
Constructs a colors selector with orientation o which contains a gradient between white and black.
QColor KGradientSelector::firstColor() const
Note: Getter function for property firstColor.
See also setFirstColor().
QString KGradientSelector::firstText() const
Note: Getter function for property firstText.
See also setFirstText().
[virtual protected]
QSize KGradientSelector::minimumSize() const
QColor KGradientSelector::secondColor() const
Note: Getter function for property secondColor.
See also setSecondColor().
QString KGradientSelector::secondText() const
Note: Getter function for property secondText.
See also setSecondText().
void KGradientSelector::setColors(const QColor &col1, const QColor &col2)
Sets the two colors which span the gradient.
void KGradientSelector::setFirstColor(const QColor &col)
Set each color on its own.
Note: Setter function for property firstColor.
See also firstColor().
void KGradientSelector::setFirstText(const QString &t)
Set each description on its own
Note: Setter function for property firstText.
See also firstText().
void KGradientSelector::setSecondColor(const QColor &col)
Note: Setter function for property secondColor.
See also secondColor().
void KGradientSelector::setSecondText(const QString &t)
Note: Setter function for property secondText.
See also secondText().
[since 4.5]
void KGradientSelector::setStops(const QGradientStops &stops)
Sets the colors that make up the gradient. Any previously set colors are removed.
This function was introduced in 4.5.
See also stops().
void KGradientSelector::setText(const QString &t1, const QString &t2)
[since 4.5]
QGradientStops KGradientSelector::stops() const
Get the colors that make up the gradient.
This function was introduced in 4.5.
See also setStops().