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