wwWidgets Home · All Classes · Main Classes · Grouped Classes · Functions

QwwColorButton Class Reference

The QwwColorButton class provides a color chooser in form of a button with a popup list More...

 #include <QwwColorButton>

Inherits QPushButton.


Properties


Public Functions

QwwColorButton ( QWidget * parent = 0 )
void addColor ( const QColor & color, const QString & name = QString::null )
void clear ()
QStringList colors () const
QColor currentColor () const
bool dragEnabled () const
void setColors ( const QStringList & map )
void setDragEnabled ( bool v )
virtual void setStandardColors ()
bool showName () const

Public Slots

void setCurrentColor ( const QColor & c )
void setShowName ( bool v )

Signals

void colorPicked ( const QColor & color )

Additional Inherited Members


Detailed Description

The QwwColorButton class provides a color chooser in form of a button with a popup list

This widget provides a push button that can be used to choose a color from either a predefined set or a custom one using a QColorDialog.

Active color can be changed either by clicking the button and choosing a different entry or by dropping a color from another widget or another application.

QwwColorButton

Colors can be added to the button with addColor(), setColors() or setStandardColors().


Property Documentation

colors : QStringList

This property holds list of colors known to the button.

Access functions:

QStringList colors () const
void setColors ( const QStringList & map )

See also currentColor.

currentColor : QColor

This property holds returns the currently chosen color.

Access functions:

QColor currentColor () const
void setCurrentColor ( const QColor & c )

dragEnabled : bool

This property holds this property holds whether the button starts a drag if the user presses and moves the mouse away from the button.

Dragging is disabled by default.

Access functions:

bool dragEnabled () const
void setDragEnabled ( bool v )

showName : bool

This property holds this property holds whether the color name should be displayed on the button.

Access functions:

bool showName () const
void setShowName ( bool v )

Member Function Documentation

QwwColorButton::QwwColorButton ( QWidget * parent = 0 )

Constructs a colour button with a specified parent.

void QwwColorButton::addColor ( const QColor & color, const QString & name = QString::null )

Adds a color with a name to the list of colors to choose from color color to add name name to associate with the color

void QwwColorButton::clear ()

Clears the color list

void QwwColorButton::colorPicked ( const QColor & color )   [signal]

This signal is emitted when color is picked and displayed on the button.

void QwwColorButton::setStandardColors ()   [virtual]

Sets standard Qt colors as the list of colors to choose from


Copyright © 2007-2010 Witold Wysota Trademarks
wwWidgets 1.0.0