roviz  0.7
Code Documentation of roviz
gui_manager_p.h
1 #ifndef GUI_MANAGER_P_H
2 #define GUI_MANAGER_P_H
3 #include <gui/gui_manager.h>
4 
5 #include <QPointer>
6 
7 struct Widget {
8  WidgetType type;
9  QPointer<QWidget> widget;
10  QStringList children;
11  Widget(WidgetType type = WidgetType::DockWidget, QWidget* widget = NULL) : type(type), widget(widget) {}
12 };
13 struct Action {
14  QStringList parents;
15  QAction* action;
16  QStringList children;
17  Action(QString parent = QString(), QAction* action = NULL) : parents(parent), action(action) {}
18 };
19 class GuiManagerPrivate : public QObject
20 {
21  Q_OBJECT
22 public:
23 
24  explicit GuiManagerPrivate(GuiManager* parent);
25 
26  GuiManager* const q_ptr;
27  Q_DECLARE_PUBLIC(GuiManager)
28 
29  QMainWindow* _mainWindow;
30  QList<std::function<bool()>> _closeApplicationCallbacks;
31  class GuiPluginManager* _uiPluginManager;
32  QHash<QString, Widget> _widgets;
33  QHash<QString, Action> _actions;
34  bool _initialized = false;
35  GuiMode _mode = GuiMode::ShowGui;
36 
37  static bool isType(QWidget* widget, WidgetType type, QString const& name);
38  bool nameUsed(QString const& name);
46  bool validParent(QString const& name, QAction *action);
47  QString registerAction(QAction* action, QString const& parent, bool recursive=true);
53  void unregisterAction(QString const& name, QString const& parent);
54  void unregisterActions(QStringList const& list);
55  void setupGui();
56  void connectProjectManager();
57 public slots:
58  void saveState();
59  void loadMainWindowState();
60 
61 protected:
62  bool eventFilter(QObject*, QEvent*);
63 
64 };
65 #endif // GUI_MANAGER_P_H
GuiMode
Definition: gui_manager.h:32
Definition: gui_manager_p.h:7
Definition: gui_manager_p.h:13
WidgetType
Information about the type of a widget.
Definition: gui_manager.h:14
Show GUI (default)
Definition: gui_manager_p.h:19
Definition: gui_plugin_manager.h:13
Widget that can be casted to a QDockwidget.
The GuiManager class handels widgets and actions on the main window.
Definition: gui_manager.h:40