[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
KLFColorComponentSpinBox Class Reference

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

#include <klfcolorchooser.h>

Inheritance diagram for KLFColorComponentSpinBox:
Collaboration diagram for KLFColorComponentSpinBox:

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

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

Constructor & Destructor Documentation

◆ KLFColorComponentSpinBox()

KLFColorComponentSpinBox::KLFColorComponentSpinBox ( QWidget * parent)

◆ ~KLFColorComponentSpinBox()

virtual KLFColorComponentSpinBox::~KLFColorComponentSpinBox ( )
inlinevirtual

Definition at line 236 of file klfcolorchooser.h.

References KLFColorComponentSpinBox().

Member Function Documentation

◆ color()

QColor KLFColorComponentSpinBox::color ( ) const
inline

Definition at line 239 of file klfcolorchooser.h.

References KLFColorComponentsEditorBase::_color.

◆ colorChanged

void KLFColorComponentSpinBox::colorChanged ( const QColor & color)
signal

◆ colorComponent()

QString KLFColorComponentSpinBox::colorComponent ( ) const
inline

Definition at line 238 of file klfcolorchooser.h.

References KLFColorComponentsEditorBase::_colorcomponent.

◆ setColor

void KLFColorComponentSpinBox::setColor ( const QColor & color)
slot

◆ setColorComponent

void KLFColorComponentSpinBox::setColorComponent ( const QString & component)
slot

Property Documentation

◆ color

QColor KLFColorComponentSpinBox::color
readwrite

Definition at line 233 of file klfcolorchooser.h.

Referenced by colorChanged(), and setColor().

◆ colorComponent

QString KLFColorComponentSpinBox::colorComponent
readwrite

Definition at line 232 of file klfcolorchooser.h.


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

Generated by doxygen 1.14.0