|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Register widgets for questions. More...
#include <mitkIQuestionWidgetFactory.h>

Public Member Functions | |
| virtual | ~IQuestionWidgetFactory () |
| Virtual destructor. More... | |
| virtual void | Register (const std::string &questionType, QmitkQuestionWidget *widgetPrototype)=0 |
| Register a QmitkQuestionWidget subclass for a certain Question type string. More... | |
| virtual QmitkQuestionWidget * | Create (Question *question, QWidget *parent=nullptr) const =0 |
| Create an instance of a matching QmitkQuestionWidget subclass for a certain question. More... | |
Static Public Member Functions | |
| static IQuestionWidgetFactory * | GetInstance () |
| Obtain a pointer to the single instance of this service. More... | |
Register widgets for questions.
This is a service interface. Obtain a pointer to its single instance via GetInstance().
Each QmitkQuestionWidget subclass must be registered by calling Register(), which is typically done in the module activator class. After QmitkQuestionWidget subclasses are registered, instances of them can be created with Create() based on their matching type of Question.
Definition at line 35 of file mitkIQuestionWidgetFactory.h.
|
virtual |
Virtual destructor.
|
pure virtual |
Create an instance of a matching QmitkQuestionWidget subclass for a certain question.
The widget is created via QmitkQuestionWidget::CreateAnother() and the given question is passed to QmitkQuestionWidget::SetQuestion().
| [in] | question | The question for which to create a widget. The widget does not take ownership. |
| [in] | parent | The parent widget for the new widget. |
Implemented in mitk::Forms::UI::QuestionWidgetFactory.
|
static |
Obtain a pointer to the single instance of this service.
nullptr if unavailable.
|
pure virtual |
Register a QmitkQuestionWidget subclass for a certain Question type string.
The service takes over ownership of the passed QmitkQuestionWidget pointer.
| [in] | questionType | The type string that identifies the Question subclass (as returned by Question::GetType()). |
| [in] | widgetPrototype | A prototype widget instance. Ownership is transferred to the service. |
Implemented in mitk::Forms::UI::QuestionWidgetFactory.