KColorCombo Class

Combobox for colors. More...

Header: #include <KColorCombo>
CMake: find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)
target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons)
Inherits: QComboBox

Properties

Public Functions

KColorCombo(QWidget *parent = nullptr)
QColor color() const
QList<QColor> colors() const
bool isCustomColor() const
void setColor(const QColor &col)
void setColors(const QList<QColor> &colors)
void showEmptyList()

Signals

void activated(const QColor &col)
void highlighted(const QColor &col)

Detailed Description

The combobox provides some preset colors to be selected, and an entry to select a custom color using a color dialog.

KColorCombo Widget

Property Documentation

color : QColor

Access functions:

QColor color() const
void setColor(const QColor &col)

Notifier signal:

void activated(const QColor &col)

colors : QList<QColor>

Access functions:

QList<QColor> colors() const
void setColors(const QList<QColor> &colors)

Member Function Documentation

[explicit] KColorCombo::KColorCombo(QWidget *parent = nullptr)

Constructs a color combo box.

[signal] void KColorCombo::activated(const QColor &col)

Emitted when a new color box has been selected.

Note: Notifier signal for property color.

QColor KColorCombo::color() const

Returns the currently selected color.

Note: Getter function for property color.

See also setColor().

QList<QColor> KColorCombo::colors() const

Return the list of colors available for selection.

Note: Getter function for property colors.

See also setColors().

[signal] void KColorCombo::highlighted(const QColor &col)

Emitted when a new item has been highlighted.

bool KColorCombo::isCustomColor() const

Find whether the currently selected color is a custom color selected using a color dialog.

void KColorCombo::setColor(const QColor &col)

Selects the color col.

Note: Setter function for property color.

See also color().

void KColorCombo::setColors(const QList<QColor> &colors)

Set a custom list of colors to choose from, in place of the standard list.

colors list of colors. If empty, the selection list reverts to the standard list.

Note: Setter function for property colors.

See also colors().

void KColorCombo::showEmptyList()

Clear the color list and don't show it, till the next setColor() call