gui::ColorTool Class Reference

Toolbar widget for changing current color. More...

#include <colortool.h>

List of all members.

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

ToolButtonpb
QPixmap * pm
QColor color
QString colorName

Detailed Description

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


Constructor & Destructor Documentation

gui::ColorTool::ColorTool ( const QString &  cName,
const QString &  niceName,
QWidget *  parent = 0,
const char *  name = NULL 
)

Default constructor of ColorTool

Parameters:
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


Member Function Documentation

void gui::ColorTool::clicked ( const QString &  name  )  [signal]

Signal emitted when user changes the color

Parameters:
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

Parameters:
id Identifier (name) of color
Returns:
string to display

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

Parameters:
e resize event
void gui::ColorTool::setColor ( const QColor &  src  ) 

Set color inside this control

Parameters:
src new color

References color, and updateColor().

QSize gui::ColorTool::sizeHint (  )  const

return size hint of this control

Returns:
size hint

References pb.

void gui::ColorTool::updateColor (  )  [protected]

Called to update control after selecting new color

Referenced by setColor().


Member Data Documentation

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

Button showing the color

Referenced by sizeHint().

QPixmap* gui::ColorTool::pm [protected]

Pixmap showing the color


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