|
Toolbox Qt
|
Button used to pick a color. More...


Public Types | |
| enum class | ColorShape { COLOR_SHAPE_CIRCLE = 0 , COLOR_SHAPE_RECT } |
Signals | |
| void | sColorChanged (const QColor &color) |
| Signal emitted when new color has been selected. | |
Public Member Functions | |
| Q_ENUM (ColorShape) | |
| ColorButton (QWidget *parent=nullptr) | |
| Create default color button. | |
| ColorShape | getShape () const |
| Use to get button current shape. | |
| const QColor & | getColor () const |
| Use to get selected color. | |
| void | setShape (ColorShape shape) |
| Use to set button shape. | |
| void | setColor (const QColor &color) |
| Use to set selected color. | |
Protected Member Functions | |
| void | paintEvent (QPaintEvent *event) override |
Button used to pick a color.
Include with:
Create a button that allow to pick a color when clicking on it and display the selected color
|
explicit |
Create default color button.
By default, shape is set to ColorShape::COLOR_SHAPE_RECT and color to Qt::white.
| [in,out] | parent | Parent widget. |
| ColorButton::ColorShape tbq::ColorButton::getShape | ( | ) | const |
| const QColor & tbq::ColorButton::getColor | ( | ) | const |
| void tbq::ColorButton::setShape | ( | ColorShape | shape | ) |
| void tbq::ColorButton::setColor | ( | const QColor & | color | ) |
Use to set selected color.
Allow to manually set selected color which will update displayed color and related tooltip button.
| [in] | color | Color to set. If invalid or same as already selected, nothing is performed. |
|
signal |
Signal emitted when new color has been selected.