itom  4.1.0
workspaceDockWidget.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef WORKSPACEDOCKWIDGET_H
24 #define WORKSPACEDOCKWIDGET_H
25 
26 #include "workspaceWidget.h"
27 #include "abstractDockWidget.h"
28 
29 #include <qwidget.h>
30 #include <qaction.h>
31 #include <qtoolbar.h>
32 #include <qevent.h>
33 
34 
35 namespace ito {
36 
37 
39 {
40  Q_OBJECT
41 
42 public:
43  WorkspaceDockWidget(const QString &title, const QString &objName, bool globalNotLocal, QWidget *parent = NULL, bool docked = true, bool isDockAvailable = true, tFloatingStyle floatingStyle = floatingNone, tMovingStyle movingStyle = movingEnabled);
45 
46 protected:
47 
48  //void closeEvent(QCloseEvent *event);
49  void dragEnterEvent(QDragEnterEvent *event);
50  void dropEvent(QDropEvent *event);
51 
52  void createActions();
53  void createMenus();
54  void createToolBars();
55  void createStatusBar(){}
56  void updateActions();
57  void updatePythonActions(){ updateActions(); }
58 
59 private:
60  bool m_globalNotLocal;
61 
62  WorkspaceWidget *m_pWorkspaceWidget;
63  ShortcutAction *m_actDelete;
64  ShortcutAction *m_actRename;
65  ShortcutAction *m_actExport;
66  ShortcutAction *m_actImport;
67  QAction *m_actUnpack;
68  ShortcutAction *m_actClearAll;
69 
70  //special actions
71  QAction *m_separatorSpecialActionsToolBar;
72  QAction *m_separatorSpecialActionsContextMenu;
73  ShortcutAction *m_dObjPlot1d;
74  ShortcutAction *m_dObjPlot2d;
75  ShortcutAction *m_dObjPlot25d;
76  ShortcutAction *m_dObjPlot3d;
77 
78  QToolBar *m_pMainToolBar;
79  QMenu* m_pContextMenu;
80  QTreeWidgetItem* m_firstCurrentItem;
81  QString m_firstCurrentItemKey;
82 
83  void mnuPlotGeneric(const QString &plotClass);
84 
85 private slots:
86  void mnuDeleteItem();
87  void mnuExportItem();
88  void mnuImportItem();
89  void mnuRenameItem();
90  void mnuToggleUnpack();
91  void mnuPlot1D();
92  void mnuPlot2D();
93  void mnuPlot25D();
94  void mnuClearAll();
95 
96  void treeWidgetItemSelectionChanged() { updateActions(); };
97  void treeWidgetItemChanged(QTreeWidgetItem * item, int column);
98  void treeViewContextMenuRequested(const QPoint &pos);
99 
100 public slots:
101  void checkToggleUnpack();
102  void propertiesChanged();
103 
104 signals:
105  void setStatusInformation(QString text, int timeout = 0);
106 };
107 
108 } //end namespace ito
109 
110 #endif
void mnuImportItem()
slot invoked if the import button has been clicked
Definition: workspaceDockWidget.cpp:365
void mnuDeleteItem()
slot invoked if the delete button has been clicked
Definition: workspaceDockWidget.cpp:234
void treeWidgetItemChanged(QTreeWidgetItem *item, int column)
slot invoked if name of element in workspaceWidget (TreeView) has been changed.
Definition: workspaceDockWidget.cpp:756
void mnuRenameItem()
slot invoked if the rename button has been clicked in the menu
Definition: workspaceDockWidget.cpp:382
~WorkspaceDockWidget()
destructor
Definition: workspaceDockWidget.cpp:112
Definition: apiFunctionsGraph.cpp:39
void createActions()
implementation for virtual method createActions in AbstractDockWidget.
Definition: workspaceDockWidget.cpp:143
void updateActions()
updates the status of all actions of this widget
Definition: workspaceDockWidget.cpp:630
void mnuToggleUnpack()
slot invoked if the unpack dictionary button has been clicked in the menu
Definition: workspaceDockWidget.cpp:401
docking widget for contents of type workspace widget
Definition: workspaceDockWidget.h:38
major class WorkspaceWidget to show a tree widget for the global and local workspace toolbox ...
Definition: workspaceWidget.h:100
Definition: shortcutAction.h:40
abstract dock widget class which inherits QDockWidget. The content of QDockWidget consists of an inst...
Definition: abstractDockWidget.h:54
WorkspaceDockWidget(const QString &title, const QString &objName, bool globalNotLocal, QWidget *parent=NULL, bool docked=true, bool isDockAvailable=true, tFloatingStyle floatingStyle=floatingNone, tMovingStyle movingStyle=movingEnabled)
constructor
Definition: workspaceDockWidget.cpp:60
tFloatingStyle
The floating style of a widget, derived from AbstractDockWidget.
Definition: abstractDockWidget.h:88
Definition: abstractDockWidget.h:90
void createToolBars()
implementation for virtual method createToolBars in AbstractDockWidget.
Definition: workspaceDockWidget.cpp:178
Definition: abstractDockWidget.h:99
void mnuExportItem()
slot invoked if the import button has been clicked
Definition: workspaceDockWidget.cpp:309
bool docked() const
Definition: abstractDockWidget.h:128
tMovingStyle
The configuration if a docked AbstractDockWidget can be moved from one docking area to another one...
Definition: abstractDockWidget.h:96