Implementation of the widget managing a couple of colors. More...
#include <QtxBiColorTool.h>
Classes | |
class | ColorLabel |
Draw colored label (for secondary color) More... | |
Public Member Functions | |
QtxBiColorTool (QWidget *=0) | |
Constructor. More... | |
virtual | ~QtxBiColorTool () |
Destructor. More... | |
QColor | mainColor () const |
Get currently selected main color. More... | |
void | setMainColor (const QColor &) |
Set main color. More... | |
int | delta () const |
Get current value delta for the secondary color. More... | |
void | setDelta (int) |
Set value delta for the secondary color. More... | |
QColor | secondaryColor () const |
Get secondary color. More... | |
QString | text () const |
Returns auxiliary text assigned to the widget. More... | |
void | setText (const QString &) |
Assign auxiliary text to the widet. More... | |
QLabel * | label () |
Get access to the internal label use for drawing auxiliary test assigned to the widget. More... | |
Private Slots | |
void | updateState () |
Update widget state. More... | |
Private Attributes | |
QtxColorButton * | myMainColor |
QLabel * | myExtraText |
QSlider * | myRuler |
ColorLabel * | myDelta |
The main color is specified explicitly. The secondary color is calculated by changing "value" of the main color in HSV notation to the specified delta.
QtxBiColorTool::QtxBiColorTool | ( | QWidget * | parent = 0 | ) |
parent | parent widget |
References BICOLOR_MAX_DELTA, Horizontal, myDelta, myExtraText, myMainColor, myRuler, and updateState().
|
virtual |
int QtxBiColorTool::delta | ( | ) | const |
QLabel * QtxBiColorTool::label | ( | ) |
References myExtraText.
QColor QtxBiColorTool::mainColor | ( | ) | const |
Returns invalid QColor if no color is selected.
References QtxColorButton::color(), and myMainColor.
QColor QtxBiColorTool::secondaryColor | ( | ) | const |
Returns invalid QColor if no main color is selected. Secondary color is calculated by changing "value" of the main color in HSV notation to the specified delta.
References delta(), mainColor(), and Qtx::mainColorToSecondary().
void QtxBiColorTool::setDelta | ( | int | d | ) |
d | new color value delta |
References myRuler, and updateState().
void QtxBiColorTool::setMainColor | ( | const QColor & | c | ) |
c | color to be set as current main color |
References myMainColor, QtxColorButton::setColor(), and updateState().
void QtxBiColorTool::setText | ( | const QString & | txt | ) |
QString QtxBiColorTool::text | ( | ) | const |
|
privateslot |
References myDelta, secondaryColor(), and QtxBiColorTool::ColorLabel::setColor().
|
private |
|
private |
|
private |
|
private |