Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitk::Forms::UI::IQuestionWidgetFactory Class Referenceabstract

Register widgets for questions. More...

#include <mitkIQuestionWidgetFactory.h>

Inheritance diagram for mitk::Forms::UI::IQuestionWidgetFactory:

Public Member Functions

virtual ~IQuestionWidgetFactory ()
 
virtual void Register (const std::string &questionType, QmitkQuestionWidget *widgetPrototype)=0
 Register a QmitkQuestionWidget subclass for a certain Question type string. More...
 
virtual QmitkQuestionWidgetCreate (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 IQuestionWidgetFactoryGetInstance ()
 Obtain a pointer to the single instance of this service. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~IQuestionWidgetFactory()

virtual mitk::Forms::UI::IQuestionWidgetFactory::~IQuestionWidgetFactory ( )
virtual

Member Function Documentation

◆ Create()

virtual QmitkQuestionWidget* mitk::Forms::UI::IQuestionWidgetFactory::Create ( Question question,
QWidget *  parent = nullptr 
) const
pure virtual

Create an instance of a matching QmitkQuestionWidget subclass for a certain question.

The given question is passed to QmitkQuestionWidget::SetQuestion().

See also
QmitkQuestionWidget::CreateAnother()

Implemented in mitk::Forms::UI::QuestionWidgetFactory.

◆ GetInstance()

static IQuestionWidgetFactory* mitk::Forms::UI::IQuestionWidgetFactory::GetInstance ( )
static

Obtain a pointer to the single instance of this service.

◆ Register()

virtual void mitk::Forms::UI::IQuestionWidgetFactory::Register ( const std::string &  questionType,
QmitkQuestionWidget widgetPrototype 
)
pure virtual

Register a QmitkQuestionWidget subclass for a certain Question type string.

The service takes over ownership of the passed QmitkQuestionWidget pointer.

See also
Question::GetType()

Implemented in mitk::Forms::UI::QuestionWidgetFactory.


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