Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkModuleTableModel Class Reference

Table model listing all CppMicroServices modules. More...

#include <QmitkModuleTableModel.h>

Inheritance diagram for QmitkModuleTableModel:
Collaboration diagram for QmitkModuleTableModel:

Public Member Functions

 QmitkModuleTableModel (QObject *parent=nullptr, us::ModuleContext *mc=nullptr)
 Construct the model. More...
 
 ~QmitkModuleTableModel () override
 Destructor. Removes the module event listener. More...
 

Protected Member Functions

int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Return the number of modules. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Return the number of columns (always 4: ID, Name, Version, Location). More...
 
QVariant data (const QModelIndex &index, int role) const override
 Return data for the given index and role. More...
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 Return column header data. More...
 

Detailed Description

Table model listing all CppMicroServices modules.

Provides four columns: ID, Name, Version, and Location. Listens for module events and automatically updates when modules are loaded or unloaded. Unloaded modules are displayed with gray text. Tooltips show detailed module info.

Definition at line 36 of file QmitkModuleTableModel.h.

Constructor & Destructor Documentation

◆ QmitkModuleTableModel()

QmitkModuleTableModel::QmitkModuleTableModel ( QObject *  parent = nullptr,
us::ModuleContext *  mc = nullptr 
)

Construct the model.

Parameters
[in]parentThe parent QObject.
[in]mcThe module context to query. Defaults to the current module context.

◆ ~QmitkModuleTableModel()

QmitkModuleTableModel::~QmitkModuleTableModel ( )
override

Destructor. Removes the module event listener.

Member Function Documentation

◆ columnCount()

int QmitkModuleTableModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
overrideprotected

Return the number of columns (always 4: ID, Name, Version, Location).

Parameters
[in]parentThe parent index (unused for table models).
Returns
4

◆ data()

QVariant QmitkModuleTableModel::data ( const QModelIndex &  index,
int  role 
) const
overrideprotected

Return data for the given index and role.

Supports Qt::DisplayRole, Qt::ForegroundRole (gray for unloaded), and Qt::ToolTipRole.

Parameters
[in]indexThe model index.
[in]roleThe data role.
Returns
The requested data as QVariant.

◆ headerData()

QVariant QmitkModuleTableModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
overrideprotected

Return column header data.

Parameters
[in]sectionThe column index.
[in]orientationThe header orientation (only Qt::Horizontal is supported).
[in]roleThe data role (only Qt::DisplayRole is supported).
Returns
The header label as QVariant.

◆ rowCount()

int QmitkModuleTableModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
overrideprotected

Return the number of modules.

Parameters
[in]parentThe parent index (unused for table models).
Returns
The number of rows (modules).

The documentation for this class was generated from the following file: