MCPcopy Create free account
hub / github.com/MITK/MITK / Register

Method Register

Modules/FormsUI/src/mitkQuestionWidgetFactory.cpp:28–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void QuestionWidgetFactory::Register(const std::string& questionType, QmitkQuestionWidget* widgetPrototype)
29{
30 if (widgetPrototype == nullptr)
31 mitkThrow() << "Cannot register nullptr as widget prototype!";
32
33 if (m_WidgetPrototypes.find(questionType) != m_WidgetPrototypes.end())
34 mitkThrow() << "A widget prototype is already registered for questions of type \"" << questionType << "\"!";
35
36 m_WidgetPrototypes[questionType].reset(widgetPrototype);
37}
38
39QmitkQuestionWidget* QuestionWidgetFactory::Create(Question* question, QWidget* parent) const
40{

Callers 1

Calls 3

resetMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected