FreeCAD C++
|
#include <Gui/QSint/actionpanel/actiongroup.h>
Class representing a single group of actions similar to Windows XP task panels.
ActionGroup consists from optional header and set of actions represented by ActionLabel. It can contain arbitrary widgets as well.
Public Slots | |
void | showHide () |
void | setExpandable (bool expandable=true) |
void | setHeader (bool enable=true) |
void | setHeaderText (const QString &title) |
Public Member Functions | |
ActionGroup (QWidget *parent=0) | |
ActionGroup (const QString &title, bool expandable=true, QWidget *parent=0) | |
ActionGroup (const QPixmap &icon, const QString &title, bool expandable=true, QWidget *parent=0) | |
ActionLabel * | addAction (QAction *action, bool addToLayout=true, bool addStretch=true) |
ActionLabel * | addActionLabel (ActionLabel *label, bool addToLayout=true, bool addStretch=true) |
bool | addWidget (QWidget *widget, bool addToLayout=true, bool addStretch=true) |
QBoxLayout * | groupLayout () |
void | setScheme (ActionPanelScheme *pointer) |
bool | isExpandable () const |
bool | hasHeader () const |
QString | headerText () const |
|
explicit |
Constructor. Creates ActionGroup without header.
|
explicit |
Constructor. Creates ActionGroup with header's text set to title, but with no icon.
If expandable set to true (default), the group can be expanded/collapsed by the user.
|
explicit |
Constructor. Creates ActionGroup with header's text set to title and icon set to icon.
If expandable set to true (default), the group can be expanded/collapsed by the user.
ActionLabel* QSint::ActionGroup::addAction | ( | QAction * | action, |
bool | addToLayout = true , |
||
bool | addStretch = true |
||
) |
Creates action item from the action and returns it.
If addToLayout is set to true (default), the action is added to the default vertical layout, i.e. subsequent calls of this function will create several ActionLabels arranged vertically, one below another.
Set addToLayout to false if you want to add the action to the specified layout manually. This allows to do custom actions arrangements, i.e. horizontal etc.
If addStretch is set to true (default), ActionLabel will be automatically aligned to the left side of the ActionGroup. Set addStretch to false if you want ActionLabel to occupy all the horizontal space.
ActionLabel* QSint::ActionGroup::addActionLabel | ( | ActionLabel * | label, |
bool | addToLayout = true , |
||
bool | addStretch = true |
||
) |
Adds label to the group.
bool QSint::ActionGroup::addWidget | ( | QWidget * | widget, |
bool | addToLayout = true , |
||
bool | addStretch = true |
||
) |
Adds widget to the group. Returns true if it has been added successfully.
QBoxLayout* QSint::ActionGroup::groupLayout | ( | ) |
Returns group's layout (QVBoxLayout by default).
bool QSint::ActionGroup::hasHeader | ( | ) | const |
Returns true if the group has header.
QString QSint::ActionGroup::headerText | ( | ) | const |
Returns text of the header. Only valid if the group has header (see hasHeader()).
bool QSint::ActionGroup::isExpandable | ( | ) | const |
Returns true if the group is expandable.
|
slot |
Makes the group expandable if expandable is set to true.
|
slot |
Enables/disables group's header according to enable.
|
slot |
Sets text of the header to title. Only valid if the group has header (see hasHeader()).
void QSint::ActionGroup::setScheme | ( | ActionPanelScheme * | pointer | ) |
Sets the scheme of the panel and all the child groups to scheme.
By default, ActionPanelScheme::defaultScheme() is used.
|
slot |
Expands/collapses the group. Only valid if the group has header (see hasHeader()).