FreeCAD C++
Public Slots | Public Member Functions | List of all members
QSint::ActionGroup Class Reference

#include <Gui/QSint/actionpanel/actiongroup.h>

Detailed Description

Class representing a single group of actions similar to Windows XP task panels.

Since
0.2
ActionGroup.png
An example of ActionGroup

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)
 
ActionLabeladdAction (QAction *action, bool addToLayout=true, bool addStretch=true)
 
ActionLabeladdActionLabel (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
 

Constructor & Destructor Documentation

◆ ActionGroup() [1/3]

QSint::ActionGroup::ActionGroup ( QWidget *  parent = 0)
explicit

Constructor. Creates ActionGroup without header.

◆ ActionGroup() [2/3]

QSint::ActionGroup::ActionGroup ( const QString &  title,
bool  expandable = true,
QWidget *  parent = 0 
)
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.

◆ ActionGroup() [3/3]

QSint::ActionGroup::ActionGroup ( const QPixmap &  icon,
const QString &  title,
bool  expandable = true,
QWidget *  parent = 0 
)
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.

Member Function Documentation

◆ addAction()

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.

◆ addActionLabel()

ActionLabel* QSint::ActionGroup::addActionLabel ( ActionLabel label,
bool  addToLayout = true,
bool  addStretch = true 
)

Adds label to the group.

See also
addAction() for the description.

◆ addWidget()

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.

See also
addAction() for the description.

◆ groupLayout()

QBoxLayout* QSint::ActionGroup::groupLayout ( )

Returns group's layout (QVBoxLayout by default).

◆ hasHeader()

bool QSint::ActionGroup::hasHeader ( ) const

Returns true if the group has header.

See also
setHeader().

◆ headerText()

QString QSint::ActionGroup::headerText ( ) const

Returns text of the header. Only valid if the group has header (see hasHeader()).

See also
setHeaderText().

◆ isExpandable()

bool QSint::ActionGroup::isExpandable ( ) const

Returns true if the group is expandable.

See also
setExpandable().

◆ setExpandable

void QSint::ActionGroup::setExpandable ( bool  expandable = true)
slot

Makes the group expandable if expandable is set to true.

See also
isExpandable().

◆ setHeader

void QSint::ActionGroup::setHeader ( bool  enable = true)
slot

Enables/disables group's header according to enable.

See also
hasHeader().

◆ setHeaderText

void QSint::ActionGroup::setHeaderText ( const QString &  title)
slot

Sets text of the header to title. Only valid if the group has header (see hasHeader()).

See also
headerText().

◆ setScheme()

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.

◆ showHide

void QSint::ActionGroup::showHide ( )
slot

Expands/collapses the group. Only valid if the group has header (see hasHeader()).