|
rock_widget_collection
0.1
|
#include <WidgetButton.h>
Inherits QPushButton.
Public Types | |
| enum | Position { Default =0, Left, Top, Right, Bottom } |
Public Slots | |
| void | setWidget (const QString &name, QWidget *widget, bool shown=true) |
| void | showWidget (bool shown) |
| QWidget * | getWidget () |
| QString | getWidgetName () |
| void | widgetUpdate (int type=0) |
| void | changePalette () |
| void | setIconAlternative (const QIcon &icon, bool isAlternative=false) |
| void | printStatus () |
| void | setActive (bool active) |
| void | corrcetName () |
Public Member Functions | |
| WidgetButton (QWidget *widget=0, Qt::Orientations dir=Qt::Horizontal, int width=150, int height=150) | |
| virtual | ~WidgetButton () |
| const Position | getPosition () const |
| const Position | getPosition () |
| void | setPosition (const Position pos) |
Protected Attributes | |
| QWidget * | mainWidget |
| QString | name |
| QBoxLayout * | layout |
| QPalette | defaultPalette |
| QPalette | redPalette |
| QTimer | paletteTimer |
| QIcon | icon |
| bool | isAlternative |
| bool | isActive |
| Qt::Orientations | dir |
Properties | |
| Position | position |
QPushButton which can display another widget or a text/icon alternatively. The widget can be showable and if not shown an icon or text will be displayed. when configured without widget display, only the icon or text will be shown.
All widgets which have a notifyUpdate(int) method will blink in red if the method is called and the widget is currently shown. When clicked the widget will stop blinking. This can be used to indicate that something has changed on the widget.
Definition at line 31 of file WidgetButton.h.
Enum to determine the position of the thumbnails
| Enumerator | |
|---|---|
| Default | |
| Left | |
| Top | |
| Right | |
| Bottom | |
Definition at line 41 of file WidgetButton.h.
| WidgetButton::WidgetButton | ( | QWidget * | widget = 0, |
| Qt::Orientations | dir = Qt::Horizontal, |
||
| int | width = 150, |
||
| int | height = 150 |
||
| ) |
|
virtual |
|
slot |
Changes the palette of the widget from red to the default scheme and the other way around, is called by a timer automatically
Definition at line 263 of file WidgetButton.cc.
|
slot |
Definition at line 76 of file WidgetButton.cc.
| const WidgetButton::Position WidgetButton::getPosition | ( | ) | const |
Definition at line 53 of file WidgetButton.cc.
|
inline |
Definition at line 55 of file WidgetButton.h.
|
slot |
|
slot |
Returns the name of the widget
Definition at line 249 of file WidgetButton.cc.
|
slot |
Definition at line 57 of file WidgetButton.cc.
|
slot |
Definition at line 64 of file WidgetButton.cc.
|
slot |
Sets an alternative Icon which can be used instead of the widget (e.g. if the widget is badly visible if sized down). If the icon is not used as alternative to the widget it is displayed instead of teh text if the widget is not shown
| icon | the icon alternative |
| isAlternative | if the icon is the alternative to the widget or to the text, defaults to false |
Definition at line 238 of file WidgetButton.cc.
|
inline |
Definition at line 56 of file WidgetButton.h.
|
slot |
Sets the widget for the button The given name will be used if the widget is not shown
| name | the name to show when the widget is not shown |
| widget | the widget to be shown |
| shown | true if the widget shall be shown on the button immediately, false otherwise, defaults to true |
Definition at line 130 of file WidgetButton.cc.
|
slot |
Show or hides the widget
| shown | true if the widget shall be shown |
Definition at line 194 of file WidgetButton.cc.
|
slot |
Slot called when an notifyUpdate from the widget was signaled.
| type | the type, currently ignored, defaults to 0 |
Definition at line 254 of file WidgetButton.cc.
|
protected |
The default palette of teh button
Definition at line 128 of file WidgetButton.h.
|
protected |
Definition at line 140 of file WidgetButton.h.
|
protected |
Icon used as alternative
Definition at line 134 of file WidgetButton.h.
|
protected |
True if this Widget is Active (not minimized)
Definition at line 138 of file WidgetButton.h.
|
protected |
If the icon is an alternative to the widget or only the text
Definition at line 136 of file WidgetButton.h.
|
protected |
The layout of the button
Definition at line 126 of file WidgetButton.h.
|
protected |
The main widget
Definition at line 117 of file WidgetButton.h.
|
protected |
The name of the widget
Definition at line 124 of file WidgetButton.h.
|
protected |
Timer for blinking red palette usage
Definition at line 132 of file WidgetButton.h.
|
protected |
A red palette
Definition at line 130 of file WidgetButton.h.
|
readwrite |
Position for the button
Definition at line 35 of file WidgetButton.h.
1.8.13