Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkModuleTableModel.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 QmitkModuleTableModel_h
14 #define QmitkModuleTableModel_h
15 
16 #include <QAbstractTableModel>
17 #include <QList>
18 
20 
21 namespace us
22 {
23  class ModuleContext;
24  class Module;
25 }
26 
27 class QmitkModuleTableModelPrivate;
28 
36 class MITKQTWIDGETSEXT_EXPORT QmitkModuleTableModel : public QAbstractTableModel
37 {
38 public:
44  QmitkModuleTableModel(QObject *parent = nullptr, us::ModuleContext *mc = nullptr);
45 
48 
49 protected:
55  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
56 
62  int columnCount(const QModelIndex &parent = QModelIndex()) const override;
63 
73  QVariant data(const QModelIndex &index, int role) const override;
74 
82  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
83 
84 private:
85  friend class QmitkModuleTableModelPrivate;
86 
87  void insertModule(us::Module *module);
88 
89  QmitkModuleTableModelPrivate *const d;
90 };
91 
92 #endif
#define MITKQTWIDGETSEXT_EXPORT
Table model listing all CppMicroServices modules.
QmitkModuleTableModel(QObject *parent=nullptr, us::ModuleContext *mc=nullptr)
Construct the model.
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
Return column header data.
~QmitkModuleTableModel() override
Destructor. Removes the module event listener.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Return the number of modules.
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Return the number of columns (always 4: ID, Name, Version, Location).
QVariant data(const QModelIndex &index, int role) const override
Return data for the given index and role.
Represents a CppMicroServices module.
Definition: usModule.h:70