Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #ifndef _QMITKViewNavigatorWidget_H_INCLUDED
13 #define _QMITKViewNavigatorWidget_H_INCLUDED
14 
15 //QT headers
16 #include <QWidget>
17 #include <QString>
18 
19 #include <ctkSearchBox.h>
20 #include "ui_QmitkViewNavigatorWidgetControls.h"
21 
24 #include <berryIWorkbench.h>
25 #include <berryIWorkbenchPage.h>
27 #include <QStandardItemModel>
28 #include <QSortFilterProxyModel>
29 #include <QMenu>
30 #include <mitkQtPerspectiveItem.h>
31 #include <mitkQtViewItem.h>
32 
33 class ClassFilterProxyModel;
34 
37 class QmitkViewNavigatorWidget : public QWidget
38 {
39  //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
40  Q_OBJECT
41 
42 public:
43 
45  QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
46  ~QmitkViewNavigatorWidget() override;
47 
48  virtual void CreateQtPartControl(QWidget *parent);
49  void setFocus();
50 
51  bool FillTreeList();
52  void UpdateTreeList(QStandardItem* item = nullptr, berry::IWorkbenchPartReference* partRef=nullptr, const std::string& changeId="");
53 
54  QScopedPointer<berry::IPerspectiveListener> m_PerspectiveListener;
55  QScopedPointer<berry::IWindowListener> m_WindowListener;
56 
57 public slots:
58 
59  void CustomMenuRequested(QPoint pos);
60  void ItemClicked(const QModelIndex &index);
63  void CloseAllPerspectives();
64  void ClosePerspective();
65  void ExpandAll();
66  void CollapseAll();
67  void FilterChanged();
68 
69 protected:
70 
72 
73  // member variables
74  Ui::QmitkViewNavigatorWidgetControls m_Controls;
75  QWidget* m_Parent;
76  QStandardItemModel* m_TreeModel;
77  ClassFilterProxyModel* m_FilterProxyModel;
78  QMenu* m_ContextMenu;
81 
82 private:
83 
85 };
86 
87 #endif // _QMITKViewNavigatorWidget_H_INCLUDED
88 
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