itom  4.1.0
bookmarkDockWidget.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 BOOKMARKDOCKWIDGET_H
24 #define BOOKMARKDOCKWIDGET_H
25 
26 #include "abstractDockWidget.h"
27 
28 #include <qwidget.h>
29 #include <qaction.h>
30 #include <qtoolbar.h>
31 #include <qitemselectionmodel.h>
32 #include "../models/bookmarkModel.h"
33 
34 #include "itomQWidgets.h"
35 
36 
37 namespace ito
38 {
44  {
45  Q_OBJECT
46 
47  public:
48 
50 
59  BookmarkDockWidget(const QString &title, const QString &objName, QWidget *parent = NULL,
60  bool docked = true, bool isDockAvailable = true,
61  tFloatingStyle floatingStyle = floatingNone,
62  tMovingStyle movingStyle = movingEnabled);
63 
66 
68 
77  void setBookmarkModel(BookmarkModel *model);
78 
79  protected:
80 
82  void createActions();
83 
85  void createMenus();
86 
88  void createToolBars();
89 
91  void createStatusBar(){}
92 
94  void updateActions();
95 
98 
99  private:
101  QToolBar *m_pMainToolbar;
102  QMenu *m_pContextMenu;
104  QAction *m_pSpacerAction;
106  private Q_SLOTS:
107 
109  /*
110  \param index is the QModelIndex of the clicked entry.
111  */
112  void doubleClicked(const QModelIndex &index);
113 
115  /*
116  \param pos is the position of the mouse click
117  */
118  void treeViewContextMenuRequested(const QPoint &pos);
119  };
120 
121 } //end namespace ito
122 
123 #endif
QToolBar * m_pMainToolbar
Definition: bookmarkDockWidget.h:101
void updateActions()
this method is overloaded from AbstractDockWidget and is called if any actions should be updated...
Definition: bookmarkDockWidget.cpp:154
model for management of all bookmarks. This model will be displayed by a viewer-widget in the main wi...
void createStatusBar()
this method is overloaded from AbstractDockWidget to initialize any status bars. Here it does nothing...
Definition: bookmarkDockWidget.h:91
QMenu * m_pContextMenu
Definition: bookmarkDockWidget.h:102
~BookmarkDockWidget()
Destructor for the toolbox.
Definition: bookmarkDockWidget.cpp:111
QAction * m_pSpacerAction
Definition: bookmarkDockWidget.h:104
void createActions()
this method creates all actions of this toolbox and is overloaded from AbstractDockWidget.
Definition: bookmarkDockWidget.cpp:135
Definition: apiFunctionsGraph.cpp:39
void createToolBars()
this method creates all menus of this toolbox and is overloaded from AbstractDockWidget.
Definition: bookmarkDockWidget.cpp:117
Provides the bookmark toolbox which is mainly a view of the BookmarkModel.
Definition: bookmarkDockWidget.h:43
void treeViewContextMenuRequested(const QPoint &pos)
This slot is executed when a context has been requested on the tree view of this toolbox.
Definition: bookmarkDockWidget.cpp:147
void doubleClicked(const QModelIndex &index)
This slot is executed when a bookmark has been double clicked.
Definition: bookmarkDockWidget.cpp:160
void createMenus()
this method creates all menus of this toolbox and is overloaded from AbstractDockWidget.
Definition: bookmarkDockWidget.cpp:141
Definition: itomQWidgets.h:62
void updatePythonActions()
this method is overloaded from AbstractDockWidget and is called whenever any Python relevant actions ...
Definition: bookmarkDockWidget.h:97
BookmarkDockWidget(const QString &title, const QString &objName, QWidget *parent=NULL, bool docked=true, bool isDockAvailable=true, tFloatingStyle floatingStyle=floatingNone, tMovingStyle movingStyle=movingEnabled)
Constructor for the toolbox.
Definition: bookmarkDockWidget.cpp:37
abstract dock widget class which inherits QDockWidget. The content of QDockWidget consists of an inst...
Definition: abstractDockWidget.h:54
BookmarkModel * m_pModel
Definition: bookmarkDockWidget.h:103
void setBookmarkModel(BookmarkModel *model)
Set the BookmarkModel for this toolbox.
Definition: bookmarkDockWidget.cpp:70
tFloatingStyle
The floating style of a widget, derived from AbstractDockWidget.
Definition: abstractDockWidget.h:88
Definition: abstractDockWidget.h:90
Definition: abstractDockWidget.h:99
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
QTreeViewItom * m_bookmarkView
Definition: bookmarkDockWidget.h:100