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 |
Implementation of the widget managing a couple of colors.
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 | ) |
Constructor.
| parent | parent widget |
References BICOLOR_MAX_DELTA, Horizontal, myDelta, myExtraText, myMainColor, myRuler, and updateState().
|
virtual |
Destructor.
| int QtxBiColorTool::delta | ( | ) | const |
Get current value delta for the secondary color.
References myRuler.
| QLabel * QtxBiColorTool::label | ( | ) |
Get access to the internal label use for drawing auxiliary test assigned to the widget.
References myExtraText.
| QColor QtxBiColorTool::mainColor | ( | ) | const |
Get currently selected main color.
Returns invalid QColor if no color is selected.
References QtxColorButton::color(), and myMainColor.
| QColor QtxBiColorTool::secondaryColor | ( | ) | const |
Get secondary color.
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 | ) |
Set value delta for the secondary color.
| d | new color value delta |
References myRuler, and updateState().
| void QtxBiColorTool::setMainColor | ( | const QColor & | c | ) |
Set main color.
| c | color to be set as current main color |
References myMainColor, QtxColorButton::setColor(), and updateState().
| void QtxBiColorTool::setText | ( | const QString & | txt | ) |
Assign auxiliary text to the widet.
| txt | new widget text |
References myExtraText.
| QString QtxBiColorTool::text | ( | ) | const |
Returns auxiliary text assigned to the widget.
References myExtraText.
|
privateslot |
Update widget state.
References myDelta, secondaryColor(), and QtxBiColorTool::ColorLabel::setColor().
|
private |
|
private |
|
private |
|
private |