Pushbutton in application toolbar. More...
#include <toolbutton.h>
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 |
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
| gui::ToolButton::ToolButton | ( | const QIcon * | iconSet, | |
| const QString | tooltip, | |||
| int | id, | |||
| QWidget * | parent = 0, |
|||
| const char * | name = "" | |||
| ) |
Constructor of ToolButton
| 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
| 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().
| void gui::ToolButton::clicked | ( | int | id | ) | [signal] |
Signal emitted when clicked on this button. The button sends ID of itself.
| 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.
| 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.
| 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
| 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().
int gui::ToolButton::b_id [private] |
ID number of this button
Referenced by slotClicked(), and ToolButton().