Toolbar widget for changing current color. More...
#include <colortool.h>
Signals | |
| void | clicked (const QString &name) |
Public Member Functions | |
| ColorTool (const QString &cName, const QString &niceName, QWidget *parent=0, const char *name=NULL) | |
| ~ColorTool () | |
| QSize | sizeHint () const |
| QString | getName () const |
| QColor | getColor () const |
| void | setColor (const QColor &src) |
Static Public Member Functions | |
| static QString | niceName (const QString &id) |
Protected Slots | |
| void | colorClicked () |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *e) |
| void | updateColor () |
Protected Attributes | |
| ToolButton * | pb |
| QPixmap * | pm |
| QColor | color |
| QString | colorName |
Toolbar widget for changing current color.
Toolbutton allowing to change color stored in the button. Scripts can read the color when needed Can be placed in toolbar in place of ordinary button
| gui::ColorTool::ColorTool | ( | const QString & | cName, | |
| const QString & | niceName, | |||
| QWidget * | parent = 0, |
|||
| const char * | name = NULL | |||
| ) |
Default constructor of ColorTool
| parent | Toolbar containing this control | |
| name | Name of this widget (passed to QWidget constructor) | |
| cName | identifier of color in this widget | |
| niceName | displayed name of color in this widget |
| gui::ColorTool::~ColorTool | ( | ) |
default destructor
| void gui::ColorTool::clicked | ( | const QString & | name | ) | [signal] |
Signal emitted when user changes the color
| name | Name of the color tool |
| void gui::ColorTool::colorClicked | ( | ) | [protected, slot] |
Called on clicking the color button
| QColor gui::ColorTool::getColor | ( | ) | const |
Return color inside this control
| QString gui::ColorTool::getName | ( | ) | const |
Return name of the color
| QString gui::ColorTool::niceName | ( | const QString & | id | ) | [static] |
For given ID return it's displayable name
| id | Identifier (name) of color |
Referenced by gui::ToolFactory::specialItem().
| void gui::ColorTool::resizeEvent | ( | QResizeEvent * | e | ) | [protected] |
Called on resizing of property editing control Will simply set the same fixed size to inner button
| e | resize event |
| void gui::ColorTool::setColor | ( | const QColor & | src | ) |
| QSize gui::ColorTool::sizeHint | ( | ) | const |
| void gui::ColorTool::updateColor | ( | ) | [protected] |
Called to update control after selecting new color
Referenced by setColor().
QColor gui::ColorTool::color [protected] |
Color selected in the color tool
Referenced by setColor().
QString gui::ColorTool::colorName [protected] |
Name of color in this widget
ToolButton* gui::ColorTool::pb [protected] |
Button showing the color
Referenced by sizeHint().
QPixmap* gui::ColorTool::pm [protected] |
Pixmap showing the color