Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
QmitkViewNavigatorWidget.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 #ifndef _QMITKViewNavigatorWidget_H_INCLUDED
17 #define _QMITKViewNavigatorWidget_H_INCLUDED
18 
19 //QT headers
20 #include <QWidget>
21 #include <QString>
22 
23 #include <ctkSearchBox.h>
24 #include "ui_QmitkViewNavigatorWidgetControls.h"
25 
28 #include <berryIWorkbench.h>
29 #include <berryIWorkbenchPage.h>
31 #include <QStandardItemModel>
32 #include <QSortFilterProxyModel>
33 #include <QMenu>
34 #include <mitkQtPerspectiveItem.h>
35 #include <mitkQtViewItem.h>
36 
37 class ClassFilterProxyModel;
38 
41 class QmitkViewNavigatorWidget : public QWidget
42 {
43  //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
44  Q_OBJECT
45 
46 public:
47 
49  QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
50  virtual ~QmitkViewNavigatorWidget();
51 
52  virtual void CreateQtPartControl(QWidget *parent);
53  void setFocus();
54 
55  bool FillTreeList();
56  void UpdateTreeList(QStandardItem* item = nullptr, berry::IWorkbenchPartReference* partRef=nullptr, const std::string& changeId="");
57 
58  QScopedPointer<berry::IPerspectiveListener> m_PerspectiveListener;
59  QScopedPointer<berry::IWindowListener> m_WindowListener;
60 
61 public slots:
62 
63  void CustomMenuRequested(QPoint pos);
64  void ItemClicked(const QModelIndex &index);
67  void CloseAllPerspectives();
68  void ClosePerspective();
69  void ExpandAll();
70  void CollapseAll();
71  void FilterChanged();
72 
73 protected:
74 
76 
77  // member variables
78  Ui::QmitkViewNavigatorWidgetControls m_Controls;
79  QWidget* m_Parent;
80  QStandardItemModel* m_TreeModel;
81  ClassFilterProxyModel* m_FilterProxyModel;
82  QMenu* m_ContextMenu;
85 
86 private:
87 
89 };
90 
91 #endif // _QMITKViewNavigatorWidget_H_INCLUDED
92 
QScopedPointer< berry::IWindowListener > m_WindowListener
void ItemClicked(const QModelIndex &index)
virtual void CreateQtPartControl(QWidget *parent)
QmitkViewNavigatorWidget(berry::IWorkbenchWindow::Pointer window, QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
Ui::QmitkViewNavigatorWidgetControls m_Controls
QStandardItemModel * m_TreeModel
void UpdateTreeList(QStandardItem *item=nullptr, berry::IWorkbenchPartReference *partRef=nullptr, const std::string &changeId="")
berry::IPerspectiveDescriptor::Pointer m_ActivePerspective
ClassFilterProxyModel * m_FilterProxyModel
QScopedPointer< berry::IPerspectiveListener > m_PerspectiveListener