Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkPropertyViewFactory Class Reference

Singleton factory for creating property view and editor widgets. More...

#include <QmitkPropertyViewFactory.h>

Public Types

enum  ViewTypes { vtDEFAULT }
 View type identifiers. More...
 
enum  EditorTypes { etDEFAULT , etALWAYS_EDIT , etON_DEMAND_EDIT }
 Editor type identifiers. More...
 

Public Member Functions

QWidget * CreateView (const mitk::BaseProperty *property, unsigned int type=0, QWidget *parent=nullptr)
 Create a read-only view widget for the given property. More...
 
QWidget * CreateEditor (mitk::BaseProperty *property, unsigned int type=0, QWidget *parent=nullptr)
 Create an editor widget for the given property. More...
 

Static Public Member Functions

static QmitkPropertyViewFactory * GetInstance ()
 Get the singleton instance. More...
 

Protected Member Functions

 QmitkPropertyViewFactory ()
 Hidden constructor; use GetInstance(). More...
 
 ~QmitkPropertyViewFactory ()
 Destructor. More...
 

Detailed Description

Singleton factory for creating property view and editor widgets.

Given a mitk::BaseProperty, this factory creates the appropriate Qt widget to either display (view) or edit the property value. Supports string, color, bool, int, float, double, and enumeration properties.

Note
Created widgets are owned by the caller and must be deleted properly.
See also
QmitkBasePropertyView, QmitkStringPropertyView, QmitkColorPropertyView, QmitkNumberPropertyView, QmitkBoolPropertyWidget, QmitkStringPropertyEditor, QmitkColorPropertyEditor, QmitkNumberPropertyEditor

Definition at line 34 of file QmitkPropertyViewFactory.h.

Member Enumeration Documentation

◆ EditorTypes

Editor type identifiers.

Enumerator
etDEFAULT 

Default (always editable) editor.

etALWAYS_EDIT 

Always-edit mode editor.

etON_DEMAND_EDIT 

On-demand (click to edit) editor.

Definition at line 44 of file QmitkPropertyViewFactory.h.

◆ ViewTypes

View type identifiers.

Enumerator
vtDEFAULT 

Default view type.

Definition at line 38 of file QmitkPropertyViewFactory.h.

Constructor & Destructor Documentation

◆ QmitkPropertyViewFactory()

QmitkPropertyViewFactory::QmitkPropertyViewFactory ( )
protected

Hidden constructor; use GetInstance().

◆ ~QmitkPropertyViewFactory()

QmitkPropertyViewFactory::~QmitkPropertyViewFactory ( )
protected

Destructor.

Member Function Documentation

◆ CreateEditor()

QWidget* QmitkPropertyViewFactory::CreateEditor ( mitk::BaseProperty *  property,
unsigned int  type = 0,
QWidget *  parent = nullptr 
)

Create an editor widget for the given property.

The caller owns the returned widget and must delete it.

Parameters
[in]propertyThe property to edit.
[in]typeThe editor type (default: etDEFAULT).
[in]parentThe parent widget.
Returns
A new QWidget for editing the property, or nullptr if unsupported.

◆ CreateView()

QWidget* QmitkPropertyViewFactory::CreateView ( const mitk::BaseProperty *  property,
unsigned int  type = 0,
QWidget *  parent = nullptr 
)

Create a read-only view widget for the given property.

The caller owns the returned widget and must delete it.

Parameters
[in]propertyThe property to display.
[in]typeThe view type (default: vtDEFAULT).
[in]parentThe parent widget.
Returns
A new QWidget displaying the property, or nullptr if unsupported.

◆ GetInstance()

static QmitkPropertyViewFactory* QmitkPropertyViewFactory::GetInstance ( )
static

Get the singleton instance.

Returns
Pointer to the factory instance.

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