Info panel which allows presenting welcome, useful hints and other information dynamically, e.g. in the dock panel of main application's window. More...
#include <QtxInfoPanel.h>

Classes | |
| class | Container |
| Container to store widgets within info panel. More... | |
| class | Title |
| Info panel's title widget. More... | |
Public Member Functions | |
| QtxInfoPanel (QWidget *=0) | |
| Create panel. More... | |
| ~QtxInfoPanel () | |
| Destructor. More... | |
| void | setTitle (const QString &) |
| Set panel's title. More... | |
| int | addLabel (const QString &, const int=-1) |
| Add left-aligned text label to the given group. More... | |
| int | addLabel (const QString &, Qt::Alignment, const int=-1) |
| Add text label to the given group. More... | |
| int | addAction (QAction *, const int=-1) |
| Add action button to the given group. More... | |
| int | addGroup (const QString &, const int=-1) |
| Add (sub-)group to the given group. More... | |
| void | remove (const int) |
| Remove given item from panel. More... | |
| void | clear (const int=-1) |
| Clear contents of panel of group. More... | |
| void | setVisible (const int, bool) |
| Change item's visibility. More... | |
| void | setEnabled (const int, bool) |
| Enable / disable item. More... | |
Private Member Functions | |
| int | generateId () const |
| Generate new unique identifier. More... | |
| QWidget * | find (const int) const |
| Find widget that represents given item. More... | |
Private Attributes | |
| Title * | title |
| Container * | container |
Info panel which allows presenting welcome, useful hints and other information dynamically, e.g. in the dock panel of main application's window.
The Info panel normally has a title (aimed to shortly present the current application's context) and a set of buttons and text labels combined into the groups (which may be nested).
Buttons normally represent some quick actions which are applicable in the current context. Text labels can be used to show additional information like hints, proposed actions, etc.
To set the title to the panel, use method setTitle(). Text label can be added to the panel with addLabel() method, action (button) is added via addAction() method.
By default, items are added to the top level, untitled group. Additionally, panel allows arranging items into groups; new group can be added with the addGroup() method.
Each of addAction(), addLabel(), addGroup() methods return item's unique identifier. This identifier can be used, for instance, to enable/disable item with setEnabled() method, hide/show with setVisible() method, remove from panel with remove() method. The same action can be added to the panel several times, e.g. to the different groups - the corresponding buttons will have different unique ids.
To remove all contents of panel, use clear() method.
| QtxInfoPanel::QtxInfoPanel | ( | QWidget * | parent = 0 | ) |
| QtxInfoPanel::~QtxInfoPanel | ( | ) |
Destructor.
| int QtxInfoPanel::addAction | ( | QAction * | action, |
| const int | groupId = -1 |
||
| ) |
Add action button to the given group.
| action | Action being added (note: parent is not changed). |
| groupId | Group's identifier. Value -1 (default) is used to add button to the top-level (untitled) group. |
References QtxInfoPanel::Container::addAction(), find(), and generateId().
| int QtxInfoPanel::addGroup | ( | const QString & | text, |
| const int | groupId = -1 |
||
| ) |
Add (sub-)group to the given group.
| text | Group's title. |
| groupId | Parent group's identifier. Value -1 (default) is used to add (sub-)group to the top-level (untitled) group (i.e. panel itself). |
References QtxInfoPanel::Container::addGroup(), find(), and generateId().
| int QtxInfoPanel::addLabel | ( | const QString & | text, |
| const int | groupId = -1 |
||
| ) |
Add left-aligned text label to the given group.
| text | Label's text. |
| groupId | Group's identifier. Value -1 (default) is used to add label to the top-level (untitled) group. |
| int QtxInfoPanel::addLabel | ( | const QString & | text, |
| Qt::Alignment | alignment, | ||
| const int | groupId = -1 |
||
| ) |
Add text label to the given group.
| text | Label's text. |
| alignment | Label's alignment. |
| groupId | Group's identifier. Value -1 (default) is used to add label to the top-level (untitled) group. |
References QtxInfoPanel::Container::addLabel(), find(), and generateId().
| void QtxInfoPanel::clear | ( | const int | groupId = -1 | ) |
Clear contents of panel of group.
| groupId | Group's identifier. Value -1 (default) is used to clear all contents of panel. |
References QtxInfoPanel::Container::clear(), and find().
|
private |
Find widget that represents given item.
| id | Item's (label's, button's, group's) identifier. |
References container, and QtxInfoPanel::Container::find().
|
private |
Generate new unique identifier.
| void QtxInfoPanel::remove | ( | const int | id | ) |
Remove given item from panel.
| id | Item's (label's, button's, group's) identifier. |
References find(), and QtxInfoPanel::Container::remove().
| void QtxInfoPanel::setEnabled | ( | const int | id, |
| bool | enabled | ||
| ) |
Enable / disable item.
| id | Item's (label's, button's, group's) identifier. |
| enabled | true to enable item, false to disable it. |
References find().
| void QtxInfoPanel::setTitle | ( | const QString & | text | ) |
| void QtxInfoPanel::setVisible | ( | const int | id, |
| bool | visible | ||
| ) |
Change item's visibility.
| id | Item's (label's, button's, group's) identifier. |
| visible | true to show item, false to hide it. |
References find().
|
private |
|
private |