Salome HOME
Issue #1834: Fix length of lines
[modules/shaper.git] / src / SamplePanelPlugin / SamplePanelPlugin_ModelWidgetCreator.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SamplePanelPlugin_ModelWidgetCreator.cpp
4 // Created:     29 Mar 2015
5 // Author:      Natalia ERMOLAEVA
6
7 #include "SamplePanelPlugin_ModelWidgetCreator.h"
8 #include "SamplePanelPlugin_ModelWidget.h"
9
10 #include <Config_WidgetAPI.h>
11
12 SamplePanelPlugin_ModelWidgetCreator::SamplePanelPlugin_ModelWidgetCreator()
13 : ModuleBase_IWidgetCreator()
14 {
15   myModelWidgetTypes.insert("QtModelWidget");
16 }
17
18 void SamplePanelPlugin_ModelWidgetCreator::widgetTypes(std::set<std::string>& theTypes)
19 {
20   theTypes = myModelWidgetTypes;
21 }
22
23 ModuleBase_ModelWidget* SamplePanelPlugin_ModelWidgetCreator::createWidgetByType(
24                                                             const std::string& theType,
25                                                             QWidget* theParent,
26                                                             Config_WidgetAPI* theWidgetApi,
27                                                             ModuleBase_IWorkshop* /*theWorkshop*/)
28 {
29   ModuleBase_ModelWidget* aModelWidget = 0;
30   if (myModelWidgetTypes.find(theType) == myModelWidgetTypes.end())
31     return aModelWidget;
32
33   if (theType == "QtModelWidget") {
34     aModelWidget = new SamplePanelPlugin_ModelWidget(theParent, theWidgetApi);
35   }
36
37   return aModelWidget;
38 }