Medical Imaging Interaction Toolkit  2023.12.00
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
13 #define QmitkViewNavigatorWidget_h
14 
15 #include "ui_QmitkViewNavigatorWidgetControls.h"
16 
17 //QT headers
18 #include <QWidget>
19 #include <QStandardItemModel>
20 #include <QMenu>
21 
22 #include <berryIPartListener.h>
24 #include <berryIWorkbenchWindow.h>
25 
26 class ClassFilterProxyModel;
27 
32 class QmitkViewNavigatorWidget : public QWidget
33 {
34  Q_OBJECT
35 
36 public:
37 
39  QWidget* parent = nullptr,
40  Qt::WindowFlags f = nullptr);
41  ~QmitkViewNavigatorWidget() override;
42 
43  void SetFocus();
44 
45 public Q_SLOTS:
46 
47  void FilterChanged();
48  void ItemClicked(const QModelIndex& index);
51  void ClosePerspective();
52  void CloseAllPerspectives();
53  void ExpandAll();
54  void CollapseAll();
55  void CustomMenuRequested(QPoint pos);
56 
57 protected:
58 
61 
63 
64 private:
65 
66  void CreateQtPartControl(QWidget* parent);
67  bool FillTreeList();
68  void UpdateTreeList(berry::IWorkbenchPart* workbenchPart = nullptr);
69 
70  void AddPerspectivesToTree();
71  void AddViewsToTree();
72  template<typename D, typename I>
73  void AddItemsToTree(D itemDescriptors, QStandardItem* rootItem,
74  QStandardItem* miscellaneousItem = nullptr, const QStringList& itemExcludeList = QStringList());
75 
76  Ui::QmitkViewNavigatorWidgetControls m_Controls;
77  QStandardItemModel* m_TreeModel;
78  ClassFilterProxyModel* m_FilterProxyModel;
79  QMenu* m_ContextMenu;
80 
81  QScopedPointer<berry::IPerspectiveListener> m_PerspectiveListener;
82  QScopedPointer<berry::IPartListener> m_ViewPartListener;
83 
85 };
86 
87 #endif
QmitkViewNavigatorWidget::ViewNavigatorPerspectiveListener
friend class ViewNavigatorPerspectiveListener
Definition: QmitkViewNavigatorWidget.h:59
QmitkViewNavigatorWidget::QmitkViewNavigatorWidget
QmitkViewNavigatorWidget(berry::IWorkbenchWindow::Pointer window, QWidget *parent=nullptr, Qt::WindowFlags f=nullptr)
berryIPartListener.h
QmitkViewNavigatorWidget::~QmitkViewNavigatorWidget
~QmitkViewNavigatorWidget() override
QmitkViewNavigatorWidget::ClosePerspective
void ClosePerspective()
QmitkViewNavigatorWidget::ViewNavigatorViewListener
friend class ViewNavigatorViewListener
Definition: QmitkViewNavigatorWidget.h:60
QmitkViewNavigatorWidget::ExpandAll
void ExpandAll()
berry::SmartPointer< Self >
QmitkViewNavigatorWidget::CustomMenuRequested
void CustomMenuRequested(QPoint pos)
QmitkViewNavigatorWidget::FilterChanged
void FilterChanged()
berryIWorkbenchWindow.h
QmitkViewNavigatorWidget::m_ActivePerspective
berry::IPerspectiveDescriptor::Pointer m_ActivePerspective
Definition: QmitkViewNavigatorWidget.h:62
berry::IWorkbenchPart
Definition: berryIWorkbenchPart.h:106
QmitkViewNavigatorWidget::ResetCurrentPerspective
void ResetCurrentPerspective()
QmitkViewNavigatorWidget::SaveCurrentPerspectiveAs
void SaveCurrentPerspectiveAs()
QmitkViewNavigatorWidget::SetFocus
void SetFocus()
berryIPerspectiveListener.h
QmitkViewNavigatorWidget
Definition: QmitkViewNavigatorWidget.h:32
QmitkViewNavigatorWidget::CloseAllPerspectives
void CloseAllPerspectives()
QmitkViewNavigatorWidget::CollapseAll
void CollapseAll()
QmitkViewNavigatorWidget::ItemClicked
void ItemClicked(const QModelIndex &index)