|
QSint Library
0.2.2
|
Class representing a panel of actions similar to Windows Vista/7 control panel items. More...
#include <actionbox.h>
Inherits QFrame.
Public Member Functions | |
| ActionBox (QWidget *parent=0) | |
| ActionBox (const QString &headerText, QWidget *parent=0) | |
| ActionBox (const QPixmap &icon, const QString &headerText, QWidget *parent=0) | |
| void | setIcon (const QPixmap &icon) |
| const QPixmap * | icon () const |
| ActionLabel * | header () const |
| ActionLabel * | createItem (QAction *action, QLayout *l=0) |
| QList< ActionLabel * > | createItems (QList< QAction * > actions) |
| ActionLabel * | createItem (const QString &text="", QLayout *l=0) |
| ActionLabel * | createItem (const QPixmap &icon, const QString &text, QLayout *l=0) |
| QSpacerItem * | createSpacer (QLayout *l=0) |
| QLayout * | createHBoxLayout () |
| QLayout * | itemLayout () const |
| void | addLayout (QLayout *l) |
| void | addWidget (QWidget *w, QLayout *l=0) |
Class representing a panel of actions similar to Windows Vista/7 control panel items.
ActionBox normally consists of an icon, clickable header and a list of actions. Every action can have own icon as well, provide tooltips and status tips, be clickable and checkable etc. i.e. behave like a normal ActionLabel.
ActionBox objects are easily customizable via CSS technology - you can get different look just by writing corresponding style sheet.
Usage of ActionBox in the application
createItem() also allows to create an ActionLabel from already existing QAction:
Customization of ActionBox via CSS
ActionBox items can be easily customized using CSS mechanism. Just create a new style and apply it to the ActionBox with setStyleSheet().
See the following example of the complete ActionBox customization. Note that QSint–ActionBox is used as a main class name. Headers are ActionLabels with property class='header'. Actions are ActionLabels with property class='action'.
|
explicit |
Constructor.
|
explicit |
Constructor.
|
explicit |
Constructor.
| void QSint::ActionBox::addLayout | ( | QLayout * | l | ) |
Adds layout l to the default layout.
| void QSint::ActionBox::addWidget | ( | QWidget * | w, |
| QLayout * | l = 0 |
||
| ) |
Adds widget w to the layout.
By default, widget is added to the default vertical layout. You can add widget to the specified layout passing it as l parameter.
| QLayout * QSint::ActionBox::createHBoxLayout | ( | ) |
Creates empty horizontal layout.
Use this function to arrange action items into a row.
| ActionLabel * QSint::ActionBox::createItem | ( | QAction * | action, |
| QLayout * | l = 0 |
||
| ) |
Creates action item from the action and returns it.
By default, action is added to the default vertical layout, i.e. subsequent calls of this function will create several actions arranged vertically, one below another.
You can add action to the specified layout passing it as l parameter. This allows to do custom actions arrangements, i.e. horizontal etc.
| ActionLabel * QSint::ActionBox::createItem | ( | const QString & | text = "", |
| QLayout * | l = 0 |
||
| ) |
Adds an action with text to the ActionBox and returns action item.
| ActionLabel * QSint::ActionBox::createItem | ( | const QPixmap & | icon, |
| const QString & | text, | ||
| QLayout * | l = 0 |
||
| ) |
Adds an action with icon and text to the ActionBox and returns action item.
This function acts just like previous one. See the description above.
| QList< ActionLabel * > QSint::ActionBox::createItems | ( | QList< QAction * > | actions | ) |
Creates action items from the actions list and returns the list of action items.
| QSpacerItem * QSint::ActionBox::createSpacer | ( | QLayout * | l = 0 | ) |
Adds a spacer and returns spacer item.
By default, a spacer is added to the default vertical layout. You can add a spacer to the specified layout passing it as l parameter.
|
inline |
Returns header item of the ActionBox.
|
inline |
Returns icon of the ActionBox.
|
inline |
Returns default layout used for actions (typically it's QVBoxLayout).
| void QSint::ActionBox::setIcon | ( | const QPixmap & | icon | ) |
Sets icon of the ActionBox to icon.