QSint Library  0.2.2
Public Types | Public Slots | Signals | Public Member Functions | List of all members
QSint::ColorButton Class Reference

A tool button to select a color from color dialog or grid. More...

#include <colorbutton.h>

Inherits QToolButton.

Public Types

enum  PickMode { PM_NONE, PM_COLORDIALOG, PM_COLORGRID }
 Defines color dialog type. More...
 

Public Slots

void setColor (const QColor &color)
 

Signals

void colorChanged (const QColor &color)
 

Public Member Functions

 ColorButton (QWidget *parent=0)
 
virtual ~ColorButton ()
 
const QColor & color () const
 
const PickMode & pickModeLeft () const
 
const PickMode & pickModeRight () const
 
void setPickModeLeft (const PickMode &mode)
 
void setPickModeRight (const PickMode &mode)
 
ColorList * scheme () const
 
void setScheme (ColorList *scheme)
 
int cellSize () const
 
void setCellSize (int size)
 

Detailed Description

A tool button to select a color from color dialog or grid.

ColorButton.png
An example of ColorButton

ColorButton is an extension of QToolButton designed to allow the user interactively choose a color from popping up dialog window.

Depending on PickMode, different kinds of color dialogs will be shown when user clicks left or right mouse button over the ColorButton (see setPickModeLeft() and setPickModeRight() functions).

You can modify the outlook of ColorButton by changing appropriate QToolButton properties. For instance, show text along with color box (ToolButtonStyle property), or show drop-down menu arrow (PopupMode property).

ColorButtons.png
Different types of ColorButton

Member Enumeration Documentation

Defines color dialog type.

Enumerator
PM_NONE 

no dialog

PM_COLORDIALOG 

standard system color dialog

PM_COLORGRID 

color grid based dialog

Constructor & Destructor Documentation

QSint::ColorButton::ColorButton ( QWidget *  parent = 0)

Constructor.

QSint::ColorButton::~ColorButton ( )
virtual

Destructor.

Member Function Documentation

int QSint::ColorButton::cellSize ( ) const
inline

Returns size of a color cell in pixels.

const QColor& QSint::ColorButton::color ( ) const
inline

Returns currently selected color.

void QSint::ColorButton::colorChanged ( const QColor &  color)
signal

Emitted when user selects a color from the dialog.

color is the picked color value.

const PickMode& QSint::ColorButton::pickModeLeft ( ) const
inline

Returns type of color dialog shown on left mouse click (PM_COLORGRID by default).

See Also
setPickModeLeft()
const PickMode& QSint::ColorButton::pickModeRight ( ) const
inline

Returns type of color dialog shown on right mouse click (PM_NONE by default).

See Also
pickModeRight()
ColorList* QSint::ColorButton::scheme ( ) const
inline

Returns currently active color scheme (by default, defaultColors() is used).

See Also
setScheme()
void QSint::ColorButton::setCellSize ( int  size)

Sets size of a color cell in pixels to size (must be > 0).

void QSint::ColorButton::setColor ( const QColor &  color)
slot

Sets current color to color.

void QSint::ColorButton::setPickModeLeft ( const PickMode &  mode)

Sets type of color dialog shown on left mouse click to mode.

void QSint::ColorButton::setPickModeRight ( const PickMode &  mode)

Sets type of color dialog shown on right mouse click to mode.

void QSint::ColorButton::setScheme ( ColorList *  scheme)

Sets color scheme to scheme.


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

© Sintegrial Technologies 2011-2014
http://www.sintegrial.com