32 #include <type_traits>
57 template <
typename ArmarXW
idgetType>
60 static_assert(std::is_base_of_v<ArmarXWidgetController, ArmarXWidgetType>,
61 "The template parameter of addWidget, must be a class that derives from ArmarXWidget");
67 if (__availableWidgets.find(creatorInstance->getWidgetName()) != __availableWidgets.end())
69 throw LocalException(QString(
"A widget with the name '"
70 + creatorInstance->getWidgetName()
71 +
"' already exists in a loaded plugin!").toStdString());
74 if (ArmarXComponentWidgetControllerPtr::dynamicCast(creatorInstance))
77 creatorInstance->getWidgetIcon(),
78 creatorInstance->getWidgetCategoryIcon()));
79 __availableWidgets[creatorInstance->getWidgetName()] = widgetInfo;
84 creatorInstance->getWidgetIcon(),
85 creatorInstance->getWidgetCategoryIcon()));
86 __availableWidgets[creatorInstance->getWidgetName()] = widgetInfo;
97 template <
typename ArmarXW
idgetType>
100 static_assert(std::is_base_of_v<ArmarXWidgetController, ArmarXWidgetType>,
101 "The template parameter of addWidget, must be a class that derives from ArmarXWidget");
105 if (__availableWidgets.find(ArmarXWidgetType::GetWidgetName()) != __availableWidgets.end())
107 throw LocalException(QString(
"A widget with the name '"
108 + ArmarXWidgetType::GetWidgetName()
109 +
"' already exists in a loaded plugin!").toStdString());
112 if (std::is_base_of_v<ArmarXComponentWidgetController, ArmarXWidgetType>)
115 ArmarXWidgetType::GetWidgetIcon(),
116 ArmarXWidgetType::GetWidgetCategoryIcon()));
117 __availableWidgets[ArmarXWidgetType::GetWidgetName()] = widgetInfo;
122 ArmarXWidgetType::GetWidgetIcon(),
123 ArmarXWidgetType::GetWidgetCategoryIcon()));
124 __availableWidgets[ArmarXWidgetType::GetWidgetName()] = widgetInfo;
135 return __availableWidgets;