[KLF Application][KLF Tools][KLF Backend][KLF Home]
KLatexFormula Project
Public Slots | Signals | Public Member Functions | Properties

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]

List of all members.

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

Properties

QString colorComponent
QColor color

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 ( ) [inline, virtual]

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]
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 [read, write]

Definition at line 223 of file klfcolorchooser.h.

QString KLFColorComponentSpinBox::colorComponent [read, write]

Definition at line 222 of file klfcolorchooser.h.


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

Generated by doxygen 1.7.3