gui::ToolButton Class Reference

Pushbutton in application toolbar. More...

#include <toolbutton.h>

List of all members.

Signals

void clicked (int id)
void helpText (const QString &message)

Public Member Functions

 ToolButton (const QIcon *iconSet, const QString tooltip, int id, QWidget *parent=0, const char *name="")
 ToolButton (const QPixmap *icon, const QString tooltip, int id, QWidget *parent=0, const char *name="")

Protected Slots

void slotClicked ()

Protected Member Functions

virtual void enterEvent (QEvent *e)
virtual void leaveEvent (QEvent *e)

Private Attributes

int b_id

Detailed Description

Pushbutton in application toolbar.

Class wrapping QToolButton, adding button ID and providing also a different constructors (with QPixmap or QIcon)
Also, emits clicked(id) signal in addition to normal clicked() signal


Constructor & Destructor Documentation

gui::ToolButton::ToolButton ( const QIcon *  iconSet,
const QString  tooltip,
int  id,
QWidget *  parent = 0,
const char *  name = "" 
)

Constructor of ToolButton

Parameters:
iconSet Icon set for this button
tooltip Text to display as tooltip
id Button Id that will be emitted : clicked(id)
parent Parent widget
name Name of button

References b_id, clicked(), and slotClicked().

gui::ToolButton::ToolButton ( const QPixmap *  icon,
const QString  tooltip,
int  id,
QWidget *  parent = 0,
const char *  name = "" 
)

Constructor of ToolButton

Parameters:
icon Icon for this button
tooltip Text to display as tooltip
id Button Id that will be emitted : clicked(id)
parent Parent widget
name Name of button

References b_id, clicked(), and slotClicked().


Member Function Documentation

void gui::ToolButton::clicked ( int  id  )  [signal]

Signal emitted when clicked on this button. The button sends ID of itself.

Parameters:
id ID of button

Referenced by slotClicked(), and ToolButton().

void gui::ToolButton::enterEvent ( QEvent *  e  )  [protected, virtual]

Event handler for mouse cursor entering button. Sends its tooltip as help text.

Parameters:
e Event

References helpText().

void gui::ToolButton::helpText ( const QString &  message  )  [signal]

Send help message when mouse cursor enters/leaves the button. Help message is sent on enter and QString::null on leave.

Parameters:
message Help message

Referenced by enterEvent(), and leaveEvent().

void gui::ToolButton::leaveEvent ( QEvent *  e  )  [protected, virtual]

Event handler for mouse cursor leaving button. Sends empty helptext, thus disabling it

Parameters:
e Event

References helpText().

void gui::ToolButton::slotClicked (  )  [protected, slot]

slot that will emit clicked with ID of whis button

References b_id, and clicked().

Referenced by ToolButton().


Member Data Documentation

int gui::ToolButton::b_id [private]

ID number of this button

Referenced by slotClicked(), and ToolButton().


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