Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxBiColorTool Class Reference

Implementation of the widget managing a couple of colors. More...

#include <QtxBiColorTool.h>

Inheritance diagram for QtxBiColorTool:
Inheritance graph

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...
 
QLabellabel ()
 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

QtxColorButtonmyMainColor
 
QLabelmyExtraText
 
QSlider * myRuler
 
ColorLabelmyDelta
 

Detailed Description

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.

Constructor & Destructor Documentation

QtxBiColorTool::QtxBiColorTool ( QWidget parent = 0)
Parameters
parentparent widget

References BICOLOR_MAX_DELTA, Horizontal, myDelta, myExtraText, myMainColor, myRuler, and updateState().

QtxBiColorTool::~QtxBiColorTool ( )
virtual

Member Function Documentation

int QtxBiColorTool::delta ( ) const
Returns
curent color value delta
See Also
setDelta(), secondaryColor()

References myRuler.

QLabel * QtxBiColorTool::label ( )

References myExtraText.

QColor QtxBiColorTool::mainColor ( ) const

Returns invalid QColor if no color is selected.

Returns
selected main color
See Also
setMainColor()

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.

Returns
secondary color
See Also
mainColor(), setMainColor(), delta(), setDelta()

References delta(), mainColor(), and Qtx::mainColorToSecondary().

void QtxBiColorTool::setDelta ( int  d)
Parameters
dnew color value delta
See Also
delta(), secondaryColor()

References myRuler, and updateState().

void QtxBiColorTool::setMainColor ( const QColor &  c)
Parameters
ccolor to be set as current main color
See Also
mainColor()

References myMainColor, QtxColorButton::setColor(), and updateState().

void QtxBiColorTool::setText ( const QString &  txt)
Parameters
txtnew widget text
See Also
text()

References myExtraText.

QString QtxBiColorTool::text ( ) const
Returns
current widget text
See Also
setText()

References myExtraText.

void QtxBiColorTool::updateState ( )
privateslot

Member Data Documentation

ColorLabel* QtxBiColorTool::myDelta
private
QLabel* QtxBiColorTool::myExtraText
private
QtxColorButton* QtxBiColorTool::myMainColor
private
QSlider* QtxBiColorTool::myRuler
private

The documentation for this class was generated from the following files: