26 #include <type_traits>
54 template <
typename ArmarXW
idgetType>
58 static_assert(std::is_base_of_v<ArmarXWidgetController, ArmarXWidgetType>,
59 "The template parameter of addWidget, must be a class that derives from "
66 if (__availableWidgets.find(creatorInstance->getWidgetName()) !=
67 __availableWidgets.end())
69 throw LocalException(QString(
"A widget with the name '" +
70 creatorInstance->getWidgetName() +
71 "' already exists in a loaded plugin!")
75 if (ArmarXComponentWidgetControllerPtr::dynamicCast(creatorInstance))
78 ArmarXComponentWidgetController::createInstance<ArmarXWidgetType>,
79 creatorInstance->getWidgetIcon(),
80 creatorInstance->getWidgetCategoryIcon()));
81 __availableWidgets[creatorInstance->getWidgetName()] = widgetInfo;
86 ArmarXWidgetController::createInstance<ArmarXWidgetType>,
87 creatorInstance->getWidgetIcon(),
88 creatorInstance->getWidgetCategoryIcon()));
89 __availableWidgets[creatorInstance->getWidgetName()] = widgetInfo;
100 template <
typename ArmarXW
idgetType>
104 static_assert(std::is_base_of_v<ArmarXWidgetController, ArmarXWidgetType>,
105 "The template parameter of addWidget, must be a class that derives from "
110 if (__availableWidgets.find(ArmarXWidgetType::GetWidgetName()) !=
111 __availableWidgets.end())
113 throw LocalException(QString(
"A widget with the name '" +
114 ArmarXWidgetType::GetWidgetName() +
115 "' already exists in a loaded plugin!")
119 if (std::is_base_of_v<ArmarXComponentWidgetController, ArmarXWidgetType>)
122 ArmarXComponentWidgetController::createInstance<ArmarXWidgetType>,
123 ArmarXWidgetType::GetWidgetIcon(),
124 ArmarXWidgetType::GetWidgetCategoryIcon()));
125 __availableWidgets[ArmarXWidgetType::GetWidgetName()] = widgetInfo;
130 ArmarXWidgetController::createInstance<ArmarXWidgetType>,
131 ArmarXWidgetType::GetWidgetIcon(),
132 ArmarXWidgetType::GetWidgetCategoryIcon()));
133 __availableWidgets[ArmarXWidgetType::GetWidgetName()] = widgetInfo;
145 return __availableWidgets;