Public Member Functions | |
qmdiActionGroup (QString name) | |
Constructs an MDI action group. | |
~qmdiActionGroup () | |
void | setName (QString name) |
sets an name for this action group | |
QString | getName () |
returns the name of the action group | |
void | addAction (QAction *action, int location=-1) |
add a new action to the action group | |
void | addActions (QActionGroup *actions, int location=-1) |
add new actions to the action group | |
void | addWidget (QWidget *widget, int location=-1) |
add a new widget to the action group | |
void | addMenu (QMenu *menu, int location=-1) |
adds a submenu to the menu or toolbar | |
void | addSeparator (int location=-1) |
adds a separator to the menu or toolbar | |
bool | containsAction (QAction *action) |
returns if an action is found in this group | |
void | removeAction (QAction *action) |
remove an action from the action group | |
void | removeActions (QActionGroup *actions) |
remove a actions from the action group | |
void | removeMenu (QMenu *menu) |
remove a menu from the action group | |
void | removeWidget (QWidget *widget) |
remove a widget from the action group | |
void | setMergePoint () |
set the location for menus and toolbar merges | |
int | getMergePoint () |
compute the best merging point for new action groups | |
void | mergeGroup (qmdiActionGroup *group) |
merges another action group actions into this action group | |
void | unmergeGroup (qmdiActionGroup *group) |
un-merges another action group actions into this action group | |
QMenu * | updateMenu (QMenu *menu=NULL) |
generates an updated menu from the items on the group list | |
QToolBar * | updateToolBar (QToolBar *toolbar) |
generates an updated toolbar from the items on the group list | |
Public Attributes | |
bool | breakAfter |
Defines if a break should be added after this action group list. |
This class defines the items that you see on a QMenu and QToolBar, with a much simplified interface. This class has the ability to merge two menus, and thus allowing the new menu to overwrite the actions of the original one.
The action group has a name, which will be used for creating a pop-up menu on a QMenuBar, or setting the toolbar name.
qmdiActionGroup::qmdiActionGroup | ( | QString | name | ) |
Constructs an MDI action group.
name | the name of the action group |
If you generate a menu from this action group, the name will be used as the title of the menu.
If you generate a toolbar from this action group, the name will be used as title of this toolbar.
qmdiActionGroup::~qmdiActionGroup | ( | ) |
Empty destructor. Destroys the object.
void qmdiActionGroup::setName | ( | QString | name | ) |
sets an name for this action group
name | the new name for the action group |
QString qmdiActionGroup::getName | ( | ) |
returns the name of the action group
void qmdiActionGroup::addAction | ( | QAction * | action, | |
int | location = -1 | |||
) |
add a new action to the action group
action | item to be added to the action group | |
location | where to add the new action |
The action is added to the end of the list, if the location parameter is -1, otherwise the location specifies where the actions are added. There is no way to reorder the actions once they are in the group.
void qmdiActionGroup::addActions | ( | QActionGroup * | actions, | |
int | location = -1 | |||
) |
add new actions to the action group
actions | items to be added to the action group | |
location | where to add the new actiongroup |
void qmdiActionGroup::addWidget | ( | QWidget * | widget, | |
int | location = -1 | |||
) |
add a new widget to the action group
widget | item to be added to the action group | |
location | where to add the new widget |
Widget is added to the end of the list if location is -1, otherwise the location specifies where the widget is added. There is no way to reorder the widgets once they are in the group. If you are are generating a menu, this widget is ignored.
void qmdiActionGroup::addMenu | ( | QMenu * | menu, | |
int | location = -1 | |||
) |
adds a submenu to the menu or toolbar
menu | item to be added to the action group | |
location | where to add the new widget |
The menu is added to the end of the list if location is -1, otherwise the location specifies where the menu is added.
If you are are generating a toolbar, this menu is ignored.
void qmdiActionGroup::addSeparator | ( | int | location = -1 |
) |
adds a separator to the menu or toolbar
location | where to add the new widget |
bool qmdiActionGroup::containsAction | ( | QAction * | action | ) |
returns if an action is found in this group
action | QAction to be tested |
void qmdiActionGroup::removeAction | ( | QAction * | action | ) |
remove an action from the action group
action | QAction item to be removed |
void qmdiActionGroup::removeActions | ( | QActionGroup * | actions | ) |
remove a actions from the action group
actions | items to be removed |
void qmdiActionGroup::removeMenu | ( | QMenu * | menu | ) |
remove a menu from the action group
menu | menu item to be removed |
void qmdiActionGroup::removeWidget | ( | QWidget * | widget | ) |
remove a widget from the action group
widget | QWidget item to be removed |
void qmdiActionGroup::setMergePoint | ( | ) |
set the location for menus and toolbar merges
int qmdiActionGroup::getMergePoint | ( | ) |
compute the best merging point for new action groups
If no merging point is defined, the default is to merge at the top of menu or toolbar.
TODO action groups should also have merging priotities
void qmdiActionGroup::mergeGroup | ( | qmdiActionGroup * | group | ) |
merges another action group actions into this action group
group | the new group to be merged |
The merge point is calculated from the list of merged action groups or the self defined action group. For more documentation see the documentation of getMergePoint.
void qmdiActionGroup::unmergeGroup | ( | qmdiActionGroup * | group | ) |
un-merges another action group actions into this action group
group | the group to be removed from this group |
QMenu * qmdiActionGroup::updateMenu | ( | QMenu * | menu = NULL |
) |
generates an updated menu from the items on the group list
menu | a |
menu | is NULL then a new menu will be allocated. |
If you are inserting that QMenu into a QMenuBar the memory deallocation will be handled by QMenuBar, and you don't have to bother about it.
If the action group contains no items, no menu will be generated, and NULL will be the returned value. If the passed
menu | is not NULL it will be deallocated. |
QToolBar * qmdiActionGroup::updateToolBar | ( | QToolBar * | toolbar | ) |
generates an updated toolbar from the items on the group list
toolbar | the toolbar to update |
toolbar | is NULL then a new toolbar will be allocated. |
If you are inserting that QToolBar into a QMainWindow the memory deallocation will be handled by QMainWindow, and you don't have to bother about it.
Defines if a break should be added after this action group list.
If you set this property to true , and you are generating a toolbar from this action group list, when the toolbar will be displayed for the fist time at the screen a break will be entered after this tool.
This will actually call:
QMainWindow::addToolBarBreak()