|
Krita Source Code Documentation
|
A pushbutton to display or allow user selection of a color. More...
#include <kis_color_button.h>
Inheritance diagram for KisColorButton:Classes | |
| class | KisColorButtonPrivate |
Public Slots | |
| void | setColor (const KoColor &c) |
Signals | |
| void | changed (const KoColor &newColor) |
Public Member Functions | |
| KoColor | color () const |
| KoColor | defaultColor () const |
| bool | isAlphaChannelEnabled () const |
| KisColorButton (const KoColor &c, const KoColor &defaultColor, QWidget *parent=0) | |
| KisColorButton (const KoColor &c, QWidget *parent=0) | |
| KisColorButton (QWidget *parent=0) | |
| QSize | minimumSizeHint () const override |
| bool | paletteViewEnabled () const |
| paletteViewEnabled | |
| void | setAlphaChannelEnabled (bool alpha) |
| void | setDefaultColor (const KoColor &c) |
| void | setPaletteViewEnabled (bool enable) |
| QSize | sizeHint () const override |
| ~KisColorButton () override | |
Protected Member Functions | |
| void | dragEnterEvent (QDragEnterEvent *) override |
| void | dropEvent (QDropEvent *) override |
| void | keyPressEvent (QKeyEvent *e) override |
| void | mouseMoveEvent (QMouseEvent *e) override |
| void | mousePressEvent (QMouseEvent *e) override |
| void | paintEvent (QPaintEvent *pe) override |
Properties | |
| bool | alphaChannelEnabled |
| KoColor | color |
| KoColor | defaultColor |
Private Attributes | |
| KisColorButtonPrivate *const | d |
A pushbutton to display or allow user selection of a color.
This widget can be used to display or allow user selection of a color.
Definition at line 26 of file kis_color_button.h.
|
explicit |
Creates a color button.
Definition at line 115 of file kis_color_button.cpp.
|
explicit |
Creates a color button with an initial color c.
Definition at line 121 of file kis_color_button.cpp.
References KisColorButton::KisColorButtonPrivate::col, and d.
| KisColorButton::KisColorButton | ( | const KoColor & | c, |
| const KoColor & | defaultColor, | ||
| QWidget * | parent = 0 ) |
Creates a color button with an initial color c and default color defaultColor.
Definition at line 128 of file kis_color_button.cpp.
References KisColorButton::KisColorButtonPrivate::col, d, defaultColor, and setDefaultColor().
|
override |
Emitted when the color of the widget is changed, either with setColor() or via user selection.
| KoColor KisColorButton::color | ( | ) | const |
Returns the currently chosen color.
Definition at line 141 of file kis_color_button.cpp.
References KisColorButton::KisColorButtonPrivate::col, and d.
| KoColor KisColorButton::defaultColor | ( | ) | const |
Returns the default color or an invalid color if no default color is set.
Definition at line 173 of file kis_color_button.cpp.
References d, and KisColorButton::KisColorButtonPrivate::m_defaultColor.
|
overrideprotected |
|
overrideprotected |
Definition at line 266 of file kis_color_button.cpp.
References _k_fromMimeData(), KoColor::fromQColor(), and setColor().
| bool KisColorButton::isAlphaChannelEnabled | ( | ) | const |
Returns true if the user is allowed to change the alpha component.
Definition at line 158 of file kis_color_button.cpp.
References d, and KisColorButton::KisColorButtonPrivate::m_alphaChannel.
|
overrideprotected |
Definition at line 276 of file kis_color_button.cpp.
References _k_fromMimeData(), _k_populateMimeData(), color, KoColor::fromQColor(), and setColor().
|
override |
Definition at line 254 of file kis_color_button.cpp.
References d, and KisColorButton::KisColorButtonPrivate::initStyleOption().
|
overrideprotected |
Definition at line 300 of file kis_color_button.cpp.
References _k_createDrag(), color, d, and KisColorButton::KisColorButtonPrivate::mPos.
|
overrideprotected |
Definition at line 294 of file kis_color_button.cpp.
References d, and KisColorButton::KisColorButtonPrivate::mPos.
|
overrideprotected |
Definition at line 196 of file kis_color_button.cpp.
References KisColorButton::KisColorButtonPrivate::col, d, KisColorButton::KisColorButtonPrivate::initStyleOption(), palette, and KoColor::toQColor().
| bool KisColorButton::paletteViewEnabled | ( | ) | const |
paletteViewEnabled
Definition at line 168 of file kis_color_button.cpp.
References d, and KisColorButton::KisColorButtonPrivate::m_palette.
| void KisColorButton::setAlphaChannelEnabled | ( | bool | alpha | ) |
When set to true, allow the user to change the alpha component of the color. The default value is false.
Definition at line 153 of file kis_color_button.cpp.
References d, and KisColorButton::KisColorButtonPrivate::m_alphaChannel.
Sets the current color to c.
Definition at line 146 of file kis_color_button.cpp.
References changed(), KisColorButton::KisColorButtonPrivate::col, and d.
Sets the default color to c.
Definition at line 178 of file kis_color_button.cpp.
References d, KisColorButton::KisColorButtonPrivate::m_bdefaultColor, and KisColorButton::KisColorButtonPrivate::m_defaultColor.
| void KisColorButton::setPaletteViewEnabled | ( | bool | enable | ) |
Allow having a palette.
Definition at line 163 of file kis_color_button.cpp.
References d, and KisColorButton::KisColorButtonPrivate::m_palette.
|
override |
Definition at line 247 of file kis_color_button.cpp.
References d, and KisColorButton::KisColorButtonPrivate::initStyleOption().
|
private |
Definition at line 118 of file kis_color_button.h.
|
readwrite |
Definition at line 36 of file kis_color_button.h.
|
readwrite |
QtCreator treats KoColor as a QColor in incorrect way, so just disable using them in QtCreator https://bugs.kde.org/show_bug.cgi?id=368483
Definition at line 34 of file kis_color_button.h.
|
readwrite |
Definition at line 35 of file kis_color_button.h.