Version: 9.15.0
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

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.

Constructor & Destructor Documentation

◆ QtxBiColorTool()

QtxBiColorTool::QtxBiColorTool ( QWidget parent = 0)

Constructor.

Parameters
parentparent widget

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

◆ ~QtxBiColorTool()

QtxBiColorTool::~QtxBiColorTool ( )
virtual

Destructor.

Member Function Documentation

◆ delta()

int QtxBiColorTool::delta ( ) const

Get current value delta for the secondary color.

Returns
curent color value delta
See also
setDelta(), secondaryColor()

References myRuler.

◆ label()

QLabel * QtxBiColorTool::label ( )

Get access to the internal label use for drawing auxiliary test assigned to the widget.

References myExtraText.

◆ mainColor()

QColor QtxBiColorTool::mainColor ( ) const

Get currently selected main color.

Returns invalid QColor if no color is selected.

Returns
selected main color
See also
setMainColor()

References QtxColorButton::color(), and myMainColor.

◆ secondaryColor()

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.

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

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

◆ setDelta()

void QtxBiColorTool::setDelta ( int  d)

Set value delta for the secondary color.

Parameters
dnew color value delta
See also
delta(), secondaryColor()

References myRuler, and updateState().

◆ setMainColor()

void QtxBiColorTool::setMainColor ( const QColor &  c)

Set main color.

Parameters
ccolor to be set as current main color
See also
mainColor()

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

◆ setText()

void QtxBiColorTool::setText ( const QString &  txt)

Assign auxiliary text to the widet.

Parameters
txtnew widget text
See also
text()

References myExtraText.

◆ text()

QString QtxBiColorTool::text ( ) const

Returns auxiliary text assigned to the widget.

Returns
current widget text
See also
setText()

References myExtraText.

◆ updateState

void QtxBiColorTool::updateState ( )
privateslot

Update widget state.

References myDelta, secondaryColor(), and QtxBiColorTool::ColorLabel::setColor().

Member Data Documentation

◆ myDelta

ColorLabel* QtxBiColorTool::myDelta
private

◆ myExtraText

QLabel* QtxBiColorTool::myExtraText
private

◆ myMainColor

QtxColorButton* QtxBiColorTool::myMainColor
private

◆ myRuler

QSlider* QtxBiColorTool::myRuler
private

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