[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Public Slots | Signals | Public Member Functions | Properties | List of all members
KLFColorComponentSpinBox Class Reference

A Spin box editing a component of a color. More...

#include <klfcolorchooser.h>

Inheritance diagram for KLFColorComponentSpinBox:
Inheritance graph
[legend]
Collaboration diagram for KLFColorComponentSpinBox:
Collaboration graph
[legend]

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
 
- Public Member Functions inherited from QSpinBox
 QSpinBox (QWidget *parent=0)
 
 setRange (int minimum, int maximum)
 
 textFromValue (int value)
 
 valueChanged (int i)
 
 valueChanged (const QString &text)
 
 valueFromText (const QString &text)
 
 QSpinBox (QWidget *parent, const char *name)
 
 QSpinBox (int minimum, int maximum, int step, QWidget *parent, const char *name=0)
 
 maxValue ()
 
 minValue ()
 
 setLineStep (int step)
 
 setMaxValue (int value)
 
 setMinValue (int value)
 
 clear ()
 
 message (const QString &message, int alignment=Qt::AlignLeft, const QColor &color=Qt::black)
 

Properties

QString colorComponent
 
QColor color
 

Additional Inherited Members

- Protected Member Functions inherited from KLFColorComponentsEditorBase
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 Protected Member Functions inherited from KLFColorComponentsEditorBase
static int valueFromNewColor (const QColor &color, const QString &component)
 
static int valueMax (const QString &component)
 
- Protected Attributes inherited from KLFColorComponentsEditorBase
QColor _color
 
QString _colorcomponent
 
QString _colorcomponent_b
 

Detailed Description

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 218 of file klfcolorchooser.h.

Constructor & Destructor Documentation

KLFColorComponentSpinBox::KLFColorComponentSpinBox ( QWidget parent)
virtual KLFColorComponentSpinBox::~KLFColorComponentSpinBox ( )
inlinevirtual

Definition at line 226 of file klfcolorchooser.h.

Member Function Documentation

QColor KLFColorComponentSpinBox::color ( ) const
inline

Definition at line 229 of file klfcolorchooser.h.

References KLFColorComponentsEditorBase::_color.

Referenced by setColor().

void KLFColorComponentSpinBox::colorChanged ( const QColor color)
signal

Referenced by setColorComponent().

QString KLFColorComponentSpinBox::colorComponent ( ) const
inline

Definition at line 228 of file klfcolorchooser.h.

References KLFColorComponentsEditorBase::_colorcomponent.

void KLFColorComponentSpinBox::setColor ( const QColor color)
slot
void KLFColorComponentSpinBox::setColorComponent ( const QString component)
slot

Property Documentation

QColor KLFColorComponentSpinBox::color
readwrite

Definition at line 223 of file klfcolorchooser.h.

QString KLFColorComponentSpinBox::colorComponent
readwrite

Definition at line 222 of file klfcolorchooser.h.


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

Generated by doxygen 1.8.11