Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkMAPAlgorithmModel Class Reference

Qt table model exposing the meta-properties of a MatchPoint registration algorithm. More...

#include <QmitkMAPAlgorithmModel.h>

Inheritance diagram for QmitkMAPAlgorithmModel:
Collaboration diagram for QmitkMAPAlgorithmModel:

Public Member Functions

 QmitkMAPAlgorithmModel (QObject *parent=nullptr)
 Constructs the algorithm model. More...
 
 ~QmitkMAPAlgorithmModel () override
 Destructor. More...
 
void SetAlgorithm (map::algorithm::RegistrationAlgorithmBase *pAlgorithm)
 Sets the algorithm whose meta-properties should be displayed. More...
 
void SetAlgorithm (map::algorithm::facet::MetaPropertyAlgorithmInterface *pMetaInterface)
 Sets the meta-property interface directly as data source. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 Returns item flags for the given model index. More...
 
QVariant data (const QModelIndex &index, int role) const override
 Returns data for the given model index and role. More...
 
QVariant headerData (int section, Qt::Orientation orientation, int role) const override
 Returns header data for the table columns. More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Returns the number of rows (meta-properties) in the model. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Returns the number of columns in the model. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 Sets a property value at the given index. More...
 

Detailed Description

Qt table model exposing the meta-properties of a MatchPoint registration algorithm.

This model wraps the MetaPropertyAlgorithmInterface of a MatchPoint algorithm and presents its configurable properties as a two-column table (Property / Value). An algorithm can be set as data source; the model retrieves all information through the MetaPropertyInterface. Editable properties (writable meta-properties) can be modified directly through the model, and changes are propagated back into the algorithm.

Supported meta-property types for display and editing: bool, int, unsigned int, long, unsigned long, float, double, and map::core::String. Unsupported types are shown with an error message.

Note
The model stores only a raw pointer to the MetaPropertyAlgorithmInterface. You must call SetAlgorithm(nullptr) or set a new algorithm before the previously set algorithm is destroyed.
See also
QmitkAlgorithmSettingsConfig, QmitkMapPropertyDelegate

Definition at line 46 of file QmitkMAPAlgorithmModel.h.

Constructor & Destructor Documentation

◆ QmitkMAPAlgorithmModel()

QmitkMAPAlgorithmModel::QmitkMAPAlgorithmModel ( QObject *  parent = nullptr)

Constructs the algorithm model.

Parameters
[in]parentOptional parent QObject for Qt memory management.

◆ ~QmitkMAPAlgorithmModel()

QmitkMAPAlgorithmModel::~QmitkMAPAlgorithmModel ( )
inlineoverride

Destructor.

Definition at line 58 of file QmitkMAPAlgorithmModel.h.

Member Function Documentation

◆ columnCount()

int QmitkMAPAlgorithmModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Returns the number of columns in the model.

Parameters
[in]parentThe parent index. Must be invalid for a flat table model.
Returns
Always 2 (Property, Value), or 0 if the parent is valid.

◆ data()

QVariant QmitkMAPAlgorithmModel::data ( const QModelIndex &  index,
int  role 
) const
override

Returns data for the given model index and role.

Column 0 returns the property name (Qt::DisplayRole). Column 1 returns the property value for Qt::DisplayRole and Qt::EditRole (if the property is readable/writable).

Parameters
[in]indexThe model index to query.
[in]roleThe data role.
Returns
A QVariant containing the requested data, or an invalid QVariant.

◆ flags()

Qt::ItemFlags QmitkMAPAlgorithmModel::flags ( const QModelIndex &  index) const
override

Returns item flags for the given model index.

Items in the value column (column 1) are editable if the corresponding meta-property is writable and its type is supported.

Parameters
[in]indexThe model index to query.
Returns
Item flags including Qt::ItemIsEditable for writable properties.

◆ headerData()

QVariant QmitkMAPAlgorithmModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
override

Returns header data for the table columns.

Provides "Property" for column 0 and "Value" for column 1 (Qt::DisplayRole, Qt::Horizontal).

Parameters
[in]sectionThe column index.
[in]orientationThe header orientation.
[in]roleThe data role.
Returns
A QVariant containing the header label, or an invalid QVariant.

◆ rowCount()

int QmitkMAPAlgorithmModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Returns the number of rows (meta-properties) in the model.

Parameters
[in]parentThe parent index. Must be invalid for a flat table model.
Returns
The number of meta-properties, or 0 if the parent is valid.

◆ SetAlgorithm() [1/2]

void QmitkMAPAlgorithmModel::SetAlgorithm ( map::algorithm::facet::MetaPropertyAlgorithmInterface *  pMetaInterface)

Sets the meta-property interface directly as data source.

Resets the model and refreshes the property list from the given interface.

Parameters
[in]pMetaInterfacePointer to the meta-property interface. May be nullptr to clear.

◆ SetAlgorithm() [2/2]

void QmitkMAPAlgorithmModel::SetAlgorithm ( map::algorithm::RegistrationAlgorithmBase *  pAlgorithm)

Sets the algorithm whose meta-properties should be displayed.

Attempts to cast the algorithm to MetaPropertyAlgorithmInterface and delegates to the overload accepting that interface.

Parameters
[in]pAlgorithmPointer to the registration algorithm. May be nullptr to clear.

◆ setData()

bool QmitkMAPAlgorithmModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

Sets a property value at the given index.

Only operates on column 1 with Qt::EditRole. Attempts to cast the QVariant value to the matching meta-property type and writes it back to the algorithm. If successful, the model is reset to reflect the change.

Parameters
[in]indexThe model index (must be in column 1).
[in]valueThe new value to set.
[in]roleMust be Qt::EditRole.
Returns
True if the value was successfully set, false otherwise.

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