|
roviz
0.7
Code Documentation of roviz
|
The GuiManager class handels widgets and actions on the main window. More...
#include <gui_manager.h>


Signals | |
| void | mainWindowActivationChange () |
| is emited when the activation of the main window changed | |
Public Member Functions | |
| void | setMode (GuiMode mode) |
Sets the GUI mode to mode. More... | |
| QWidget * | removeWidget (QString const &name) |
| removeFromLayout removes widget from the GUI. Caller takes ownership of the widget More... | |
| bool | addWidget (QWidget *widget, QString const &name, WidgetArea area, WidgetType type=WidgetType::DockWidget) |
| Adds a widget to the mainwindow. More... | |
| QString | addWidget (QWidget *widget, WidgetArea area, WidgetType type=WidgetType::DockWidget) |
| Adds a widget to the mainwindow. Uses the objectName or className as name. Appends a number if a a widget is already stored with that name. More... | |
| bool | moveWidget (QString const &name, WidgetArea area) |
| moveWidget change the position of a widget More... | |
| void | setVisible (QString const &name, bool visible) |
| setVisible changes the visibility of a widget More... | |
| QWidget * | widgetReference () |
| widgetReference method to access the main window More... | |
| bool | addAction (QAction *action, QString const &name, QString const &parent) |
| adds an action a menu or a toolbar More... | |
| bool | addActionToParent (QString const &name, QString const &parent) |
| Adds the action name to the action or widget parent. More... | |
| QString | addAction (QAction *action, QString const &parent) |
| Adds an action to a menu or a toolbar Uses the objectName or className as name. Appends a number if something is already stored with that name. More... | |
| QAction * | action (QString const &name) const |
| Access to reference of an action. More... | |
| QAction * | removeAction (QString const &name, QString const &parent=QString()) |
| Removes an action from the gui and returns it. More... | |
| void | registerCloseHandler (std::function< bool()> callback) |
| This callback will be executed by an application close event. If the callback returns true the close process will be continue -> shutdown application. If the callback returns false the close process will be interrupted. More... | |
| QStringList | parents (QString const &name) |
| Access to the names of the parents of an registered action. More... | |
| QStringList | children (QString const &name) const |
| Access to the names of the children of an registered action or widget. More... | |
| QStringList | registeredActions () const |
| Access to all the names of the registered actions. More... | |
| QStringList | registeredWidgets () const |
| Access to all the names of the registered widgets. More... | |
| QStringList | registeredWidgets (WidgetType type) const |
| registeredWidgets return all registered widgets of the given type More... | |
| bool | mainWindowIsActive () const |
| mainWindowIsActive More... | |
Protected Member Functions | |
| bool | postInit () |
| postInit will be called after all components and singletons have been constructed/initialized More... | |
| bool | preDestroy () |
| preDestroy will be called before any of the components and singletons will be destructed/deinitailized More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Singleton< GuiManager > | |
| static GuiManager * | instance () |
| Returns the current instance of the singleton. More... | |
The GuiManager class handels widgets and actions on the main window.
| QAction * GuiManager::action | ( | QString const & | name | ) | const |
Access to reference of an action.
| name | Name of the action |

| bool GuiManager::addAction | ( | QAction * | action, |
| QString const & | name, | ||
| QString const & | parent | ||
| ) |
adds an action a menu or a toolbar
| Action | The action that is added, GuiManager doesn't takes ownership, can't be NULL |
| Name | The name of the action, is used to access the action later on, must be unique or |
| parent | The name of the parent under which the action is added, parent must be an action that is a menu, a menubar when the action is a menu or a toolbar when the action isn't a menu |
| QString GuiManager::addAction | ( | QAction * | action, |
| QString const & | parent | ||
| ) |
Adds an action to a menu or a toolbar
Uses the objectName or className as name.
Appends a number if something is already stored with that name.
| action | Pointer to the action, GuiManager doesn't takes ownership |
| parent | The name of the parent under which the action is added, parent must be an action that is a menu, a menubar when the action is a menu or a toolbar when the action isn't a menu |
| bool GuiManager::addActionToParent | ( | QString const & | name, |
| QString const & | parent | ||
| ) |
Adds the action name to the action or widget parent.
| name | Name of the action or widget, must be an action |
| parent,The | name of the parent under which the action is added, parent must be an action that is a menu, a menubar when the action is a menu or a toolbar when the action isn't a menu |
| bool GuiManager::addWidget | ( | QWidget * | widget, |
| QString const & | name, | ||
| WidgetArea | area, | ||
| WidgetType | type = WidgetType::DockWidget |
||
| ) |
Adds a widget to the mainwindow.
| widget | pointer to the widget, action that are already within a Toolbar or MenuBar are also registered whe |
| name | name of the specified widget, name can be used to access the widget later, must be unique |
| area | dock- or toolbox-area where the widget will be placed, use WidgetType::NoArea for other widgets |
| type | what type of widget it is. Note that if a widget with a type that occurs only once (CentralWidget, MenuBar, StatusBar) is added, the old widget will be deleted. |
Takes the ownership of the passed window

| QString GuiManager::addWidget | ( | QWidget * | widget, |
| WidgetArea | area, | ||
| WidgetType | type = WidgetType::DockWidget |
||
| ) |
Adds a widget to the mainwindow.
Uses the objectName or className as name.
Appends a number if a a widget is already stored with that name.
| widget | pointer to the widget, action that are already within a Toolbar or MenuBar are also registered |
| area | dock- or toolbox-area where the widget will be placed, use WidgetType::NoArea for other widgets |
| type | what type of widget it is. Note that if a widget with a type that occurs only once (CentralWidget, MenuBar, StatusBar) is added, the old widget will be deleted. |
| QStringList GuiManager::children | ( | QString const & | name | ) | const |
Access to the names of the children of an registered action or widget.
| name | Name of the action or widget |
| bool GuiManager::mainWindowIsActive | ( | ) | const |
mainWindowIsActive
| bool GuiManager::moveWidget | ( | QString const & | name, |
| WidgetArea | area | ||
| ) |
moveWidget change the position of a widget
| name | name of the widget that should be moved |
| area | area where the widget will be moved to |
| QStringList GuiManager::parents | ( | QString const & | name | ) |
Access to the names of the parents of an registered action.
| name | Name of the action |
|
protectedvirtual |
postInit will be called after all components and singletons have been constructed/initialized
Implements AbstractSingleton.
|
protectedvirtual |
preDestroy will be called before any of the components and singletons will be destructed/deinitailized
Implements AbstractSingleton.

| void GuiManager::registerCloseHandler | ( | std::function< bool()> | callback | ) |
This callback will be executed by an application close event. If the callback returns true the close process will be continue -> shutdown application. If the callback returns false the close process will be interrupted.
| std::function<bool> | callback |

| QStringList GuiManager::registeredActions | ( | ) | const |
Access to all the names of the registered actions.
| QStringList GuiManager::registeredWidgets | ( | ) | const |
Access to all the names of the registered widgets.
| QStringList GuiManager::registeredWidgets | ( | WidgetType | type | ) | const |
registeredWidgets return all registered widgets of the given type
| type | Type to be returned |
| QAction * GuiManager::removeAction | ( | QString const & | name, |
| QString const & | parent = QString() |
||
| ) |
Removes an action from the gui and returns it.
| name | name of the action |
| parent | parent of the action, will remove all occurences if string is empty. None when parent doesn't exist |
| QWidget * GuiManager::removeWidget | ( | QString const & | name | ) |
removeFromLayout removes widget from the GUI. Caller takes ownership of the widget
| widget | id that is removed |
| void GuiManager::setMode | ( | GuiMode | mode | ) |
Sets the GUI mode to mode.
| mode | The new GUI mode to use |

| void GuiManager::setVisible | ( | QString const & | name, |
| bool | visible | ||
| ) |
setVisible changes the visibility of a widget
| name | name of the widget |
| visible | value that the visibility is set to |
| QWidget * GuiManager::widgetReference | ( | ) |
widgetReference method to access the main window
1.8.13