KDEUI
#include <kcolorbutton.h>

Signals | |
void | changed (const QColor &newColor) |
Public Member Functions | |
KColorButton (const QColor &c, const QColor &defaultColor, QWidget *parent=0) | |
KColorButton (const QColor &c, QWidget *parent=0) | |
KColorButton (QWidget *parent=0) | |
virtual | ~KColorButton () |
QColor | color () const |
QColor | defaultColor () const |
bool | isAlphaChannelEnabled () const |
QSize | minimumSizeHint () const |
void | setAlphaChannelEnabled (bool alpha) |
void | setColor (const QColor &c) |
void | setDefaultColor (const QColor &c) |
QSize | sizeHint () const |
Protected Member Functions | |
virtual void | dragEnterEvent (QDragEnterEvent *) |
virtual void | dropEvent (QDropEvent *) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | paintEvent (QPaintEvent *pe) |
Properties | |
bool | alphaChannelEnabled |
QColor | color |
QColor | defaultColor |
Detailed Description
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.
- See also
- KColorDialog

Definition at line 37 of file kcolorbutton.h.
Constructor & Destructor Documentation
◆ KColorButton() [1/3]
|
explicit |
Creates a color button.
Definition at line 74 of file kcolorbutton.cpp.
◆ KColorButton() [2/3]
|
explicit |
Creates a color button with an initial color c
.
Definition at line 80 of file kcolorbutton.cpp.
◆ KColorButton() [3/3]
KColorButton::KColorButton | ( | const QColor & | c, |
const QColor & | defaultColor, | ||
QWidget * | parent = 0 |
||
) |
Creates a color button with an initial color c
and default color defaultColor
.
Definition at line 87 of file kcolorbutton.cpp.
◆ ~KColorButton()
|
virtual |
Definition at line 95 of file kcolorbutton.cpp.
Member Function Documentation
◆ changed
|
signal |
Emitted when the color of the widget is changed, either with setColor() or via user selection.
◆ color()
QColor KColorButton::color | ( | ) | const |
Returns the currently chosen color.
Definition at line 100 of file kcolorbutton.cpp.
◆ defaultColor()
QColor KColorButton::defaultColor | ( | ) | const |
Returns the default color or an invalid color if no default color is set.
Definition at line 124 of file kcolorbutton.cpp.
◆ dragEnterEvent()
|
protectedvirtual |
Definition at line 202 of file kcolorbutton.cpp.
◆ dropEvent()
|
protectedvirtual |
Definition at line 207 of file kcolorbutton.cpp.
◆ isAlphaChannelEnabled()
bool KColorButton::isAlphaChannelEnabled | ( | ) | const |
Returns true if the user is allowed to change the alpha component.
- Since
- 4.5
Definition at line 119 of file kcolorbutton.cpp.
◆ keyPressEvent()
|
protectedvirtual |
Definition at line 215 of file kcolorbutton.cpp.
◆ minimumSizeHint()
QSize KColorButton::minimumSizeHint | ( | ) | const |
Definition at line 194 of file kcolorbutton.cpp.
◆ mouseMoveEvent()
|
protectedvirtual |
Definition at line 238 of file kcolorbutton.cpp.
◆ mousePressEvent()
|
protectedvirtual |
Definition at line 232 of file kcolorbutton.cpp.
◆ paintEvent()
|
protectedvirtual |
Definition at line 146 of file kcolorbutton.cpp.
◆ setAlphaChannelEnabled()
void KColorButton::setAlphaChannelEnabled | ( | bool | alpha | ) |
When set to true, allow the user to change the alpha component of the color.
The default value is false.
- Since
- 4.5
Definition at line 114 of file kcolorbutton.cpp.
◆ setColor()
void KColorButton::setColor | ( | const QColor & | c | ) |
Sets the current color to c
.
Definition at line 105 of file kcolorbutton.cpp.
◆ setDefaultColor()
void KColorButton::setDefaultColor | ( | const QColor & | c | ) |
Sets the default color to c
.
Definition at line 129 of file kcolorbutton.cpp.
◆ sizeHint()
QSize KColorButton::sizeHint | ( | ) | const |
Definition at line 186 of file kcolorbutton.cpp.
Property Documentation
◆ alphaChannelEnabled
|
readwrite |
Definition at line 1 of file kcolorbutton.h.
◆ color
|
readwrite |
Definition at line 1 of file kcolorbutton.h.
◆ defaultColor
|
readwrite |
Definition at line 1 of file kcolorbutton.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.