Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
QmitkPatientTableHeaderView.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 QmitkPatientTableHeaderView_h
14 #define QmitkPatientTableHeaderView_h
15 
16 // semantic relations ui module
18 
19 // qt
20 #include <QStandardItemModel>
21 #include <QHeaderView>
22 #include <QPointer>
23 
24 /*
25 * @brief
26 */
28 {
29  Q_OBJECT
30 
31 public:
32 
33  QmitkPatientTableHeaderView(QWidget* parent = nullptr);
34  ~QmitkPatientTableHeaderView() override;
35 
37  {
38  HorizontalHeaderDataRole = Qt::UserRole
39  };
40 
47  void setModel(QAbstractItemModel* model) override;
48 
49 protected:
50 
55  void paintSection(QPainter* painter, const QRect& rect, int logicalIndex) const override;
61  QSize sectionSizeFromContents(int logicalIndex) const override;
62 
63 private:
64 
65  int PaintHeader(QPainter* painter, const QModelIndex& currentIndex, int logicalIndex, const QRect& sectionRect, int top) const;
66  QSize HeaderSize(const QModelIndex& index) const;
67  int CurrentHeaderLeft(const QModelIndex& currentIndex, const QModelIndex& headerIndex, int sectionIndex, int left) const;
68  int CurrentHeaderWidth(const QModelIndex& currentIndex, const QModelIndex& headerIndex, int sectionIndex) const;
69 
70  QModelIndexList ParentIndexList(QModelIndex index) const;
71  QModelIndex HeaderIndex(int sectionIndex) const;
72  QModelIndex FindHeader(const QModelIndex& currentIndex, int sectionIndex, int& currentHeaderIndex) const;
73  QModelIndexList ListHeader(const QModelIndex& currentIndex) const;
74 
75  QStandardItemModel* m_HeaderModel;
76 
77 };
78 
79 #endif
MitkSemanticRelationsUIExports.h
MITKSEMANTICRELATIONSUI_EXPORT
#define MITKSEMANTICRELATIONSUI_EXPORT
Definition: MitkSemanticRelationsUIExports.h:15
QmitkPatientTableHeaderView
Definition: QmitkPatientTableHeaderView.h:27
QmitkPatientTableHeaderView::HeaderDataModelRoles
HeaderDataModelRoles
Definition: QmitkPatientTableHeaderView.h:36