CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkDICOMItemTreeModel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkDICOMItemTreeModel_h
22 #define __ctkDICOMItemTreeModel_h
23 
24 // Qt includes
25 #include <QAbstractItemModel>
26 #include <QModelIndex>
27 
28 #include "ctkDICOMWidgetsExport.h"
29 
30 class ctkDICOMItemTreeModelPrivate;
31 
33 class CTK_DICOM_WIDGETS_EXPORT ctkDICOMItemTreeModel : public QAbstractItemModel
34 {
35 public:
36  typedef QAbstractItemModel Superclass;
37  explicit ctkDICOMItemTreeModel(QObject* parent=0);
39 
40  virtual QModelIndex index(int row, int column,
41  const QModelIndex &parent = QModelIndex()) const;
42 
43  virtual QModelIndex parent(const QModelIndex &child) const;
44 
45  virtual Qt::ItemFlags flags(const QModelIndex &index) const;
46 
47  virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
48 
49  virtual QVariant headerData(int section, Qt::Orientation orientation,
50  int role = Qt::DisplayRole) const;
51 
52  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
53  virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
54 
55 protected:
56  QScopedPointer<ctkDICOMItemTreeModelPrivate> d_ptr;
57 
58 private:
59  Q_DECLARE_PRIVATE(ctkDICOMItemTreeModel);
60  Q_DISABLE_COPY(ctkDICOMItemTreeModel);
61 };
62 
63 #endif
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
virtual QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
virtual Qt::ItemFlags flags(const QModelIndex &index) const
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
QAbstractItemModel Superclass
QScopedPointer< ctkDICOMItemTreeModelPrivate > d_ptr
virtual QModelIndex parent(const QModelIndex &child) const
ctkDICOMItemTreeModel(QObject *parent=0)
virtual ~ctkDICOMItemTreeModel()
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const