A Spin box editing a component of a color. More...
#include <klfcolorchooser.h>
Public Slots | |
void | setColorComponent (const QString &component) |
void | setColor (const QColor &color) |
Signals | |
void | colorChanged (const QColor &color) |
Public Member Functions | |
KLFColorComponentSpinBox (QWidget *parent) | |
virtual | ~KLFColorComponentSpinBox () |
QString | colorComponent () const |
QColor | color () const |
Properties | |
QString | colorComponent |
QColor | color |
Additional Inherited Members | |
![]() | |
int | valueAFromNewColor (const QColor &color) const |
int | valueBFromNewColor (const QColor &color) const |
int | valueA () const |
int | valueB () const |
int | valueAMax () const |
int | valueBMax () const |
QColor | colorFromValues (QColor color_base, int value_a, int value_b=-1) |
bool | refreshColorFromInternalValues (int value_a, int value_b=-1) |
![]() | |
static int | valueFromNewColor (const QColor &color, const QString &component) |
static int | valueMax (const QString &component) |
![]() | |
QColor | _color |
QString | _colorcomponent |
QString | _colorcomponent_b |
A Spin box editing a component of a color.
the color component is given as a string, one of those listed in documentation for KLFColorComponentsEditorBase.
Use setColorComponent() to set the component, then use setColor() to set a color, and connect to colorChanged() for changes by the user to this component, and retrieve the color with color(). color() returns the color that was set with setColor(), except that the compoenent being edited was adjusted to the currently edited value.
You can retrieve the value of the component being edited with the value() member (inherited from QSpinBox).
Example usage is to have multiple instances of this spin box editing different components, with a chain (looped) of colorChanged() signals connected to the setColor() of the next spin box in such way as to have all spin boxes being up to date. With this trick you can edit components that are not independant (eg. saturation and red values; they need to update each other when edited).
See KLFColorChooseWidget for an example.
Definition at line 228 of file klfcolorchooser.h.
KLFColorComponentSpinBox::KLFColorComponentSpinBox | ( | QWidget * | parent | ) |
Definition at line 526 of file klfcolorchooser.cpp.
References KLFColorComponentsEditorBase::_color, setColor(), setColorComponent(), and KLFColorComponentsEditorBase::valueAFromNewColor().
|
inlinevirtual |
Definition at line 236 of file klfcolorchooser.h.
|
inline |
Definition at line 239 of file klfcolorchooser.h.
References KLFColorComponentsEditorBase::_color.
Referenced by setColor().
|
signal |
Referenced by setColorComponent().
|
inline |
Definition at line 238 of file klfcolorchooser.h.
References KLFColorComponentsEditorBase::_colorcomponent.
|
slot |
Definition at line 552 of file klfcolorchooser.cpp.
References KLFColorComponentsEditorBase::_color, color(), and KLFColorComponentsEditorBase::valueAFromNewColor().
Referenced by KLFColorComponentSpinBox().
|
slot |
Definition at line 539 of file klfcolorchooser.cpp.
References KLFColorComponentsEditorBase::_color, KLFColorComponentsEditorBase::_colorcomponent, colorChanged(), KLFColorComponentsEditorBase::refreshColorFromInternalValues(), QString::toLower(), and KLFColorComponentsEditorBase::valueAMax().
Referenced by KLFColorComponentSpinBox().
|
readwrite |
Definition at line 233 of file klfcolorchooser.h.
|
readwrite |
Definition at line 232 of file klfcolorchooser.h.