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
berryViewTreeModel.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
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 
17 #ifndef BERRYVIEWTREEMODEL_H
18 #define BERRYVIEWTREEMODEL_H
19 
21 
22 #include <berrySmartPointer.h>
23 
24 #include <QAbstractItemModel>
25 
26 namespace berry {
27 
28 struct IViewRegistry;
29 struct IWorkbenchWindow;
30 
31 class BERRY_UI_QT ViewTreeModel : public QAbstractItemModel
32 {
33  Q_OBJECT
34 
35 public:
36 
37  ViewTreeModel(const IWorkbenchWindow* window,
38  QObject* parent = nullptr);
39 
40  ~ViewTreeModel();
41 
42  enum Role {
43  Description = Qt::UserRole,
45  Id
46  };
47 
48  QVariant data(const QModelIndex &index, int role) const override;
49  Qt::ItemFlags flags(const QModelIndex& index) const override;
50  QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
51  QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
52  QModelIndex parent(const QModelIndex &child) const override;
53  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
54  int columnCount(const QModelIndex &parent = QModelIndex()) const override;
55 
56  const IWorkbenchWindow* GetWorkbenchWindow() const;
57 
58 private:
59 
60  struct Impl;
61  QScopedPointer<Impl> d;
62 };
63 
64 }
65 
66 #endif // BERRYVIEWTREEMODEL_H
#define BERRY_UI_QT