|
QSint Library
0.2.2
|
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) |
A tool button to select a color from color dialog or grid.
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).
| QSint::ColorButton::ColorButton | ( | QWidget * | parent = 0 | ) |
Constructor.
|
virtual |
Destructor.
|
inline |
Returns size of a color cell in pixels.
|
inline |
Returns currently selected color.
|
signal |
Emitted when user selects a color from the dialog.
color is the picked color value.
|
inline |
Returns type of color dialog shown on left mouse click (PM_COLORGRID by default).
|
inline |
Returns type of color dialog shown on right mouse click (PM_NONE by default).
|
inline |
Returns currently active color scheme (by default, defaultColors() is used).
| void QSint::ColorButton::setCellSize | ( | int | size | ) |
Sets size of a color cell in pixels to size (must be > 0).
|
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.