From b856520cf4cb2f4a9a1cc58c9efa8952b377672c Mon Sep 17 00:00:00 2001
From: Raphael Grimm <raphael.grimm@student.kit.edu>
Date: Wed, 2 Aug 2017 22:47:06 +0200
Subject: [PATCH] Change the base of gui plugins from
 ArmarXComponentWidgetController to the CRTP version
 ArmarXComponentWidgetControllerTemplate

---
 .../ArmarXGui/Widgets/EmergencyStopWidget.h   | 14 +--------
 .../ClockPlugin/ClockWidgetController.h       | 10 +-----
 .../ConditionViewerWidgetController.h         |  6 +---
 .../IceProxy/IceProxyWidgetController.h       | 22 ++++++-------
 .../LoggingPlugin/ArmarXLogViewer/LogViewer.h | 14 +--------
 .../ObserverWidgetController.h                | 16 ++--------
 .../PlotterPlugin/ArmarXPlotter.cpp           | 31 ++-----------------
 .../gui-plugins/PlotterPlugin/ArmarXPlotter.h | 26 +---------------
 .../StaticPlotterWidgetController.h           | 11 ++-----
 .../ScenarioManagerWidgetController.h         | 10 +-----
 .../StatechartEditorController.h              | 14 +--------
 .../EventSenderOverview.cpp                   | 11 -------
 .../EventSenderOverview.h                     |  8 ++---
 .../StatechartViewerController.h              | 10 +-----
 .../IceGridViewer/IceGridViewer.h             |  6 +---
 .../SystemStateMonitorWidget.h                | 10 +-----
 .../ThreadViewer/ThreadViewer.h               | 10 +-----
 .../TopicReplayerWidgetController.h           |  7 +----
 18 files changed, 30 insertions(+), 206 deletions(-)

diff --git a/source/ArmarXGui/applications/ArmarXGui/Widgets/EmergencyStopWidget.h b/source/ArmarXGui/applications/ArmarXGui/Widgets/EmergencyStopWidget.h
index da42677e..0cc48965 100644
--- a/source/ArmarXGui/applications/ArmarXGui/Widgets/EmergencyStopWidget.h
+++ b/source/ArmarXGui/applications/ArmarXGui/Widgets/EmergencyStopWidget.h
@@ -41,7 +41,7 @@ namespace armarx
     class ArmarXMainWindow;
 
     class EmergencyStopWidget :
-        public armarx::ArmarXComponentWidgetController,
+        public ArmarXComponentWidgetControllerTemplate<EmergencyStopWidget>,
         public armarx::EmergencyStopListener
     {
         Q_OBJECT
@@ -71,13 +71,8 @@ namespace armarx
 
         EmergencyStopMasterInterfacePrx emergencyStopMasterPrx;
 
-
         // ArmarXWidgetController interface
     public:
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "EmergencyStopWidget";
@@ -89,13 +84,6 @@ namespace armarx
     public:
         void reportEmergencyStopState(EmergencyStopState, const Ice::Current&);
     };
-
     typedef IceInternal::Handle <EmergencyStopWidget> EmergencyStopWidgetPtr;
 }
-
-
-
-
-
-
 #endif
diff --git a/source/ArmarXGui/gui-plugins/ClockPlugin/ClockWidgetController.h b/source/ArmarXGui/gui-plugins/ClockPlugin/ClockWidgetController.h
index b4e2c49e..84b3847e 100644
--- a/source/ArmarXGui/gui-plugins/ClockPlugin/ClockWidgetController.h
+++ b/source/ArmarXGui/gui-plugins/ClockPlugin/ClockWidgetController.h
@@ -59,7 +59,7 @@ namespace armarx
      */
     class ARMARXCOMPONENT_IMPORT_EXPORT
         ClockWidgetController:
-        public armarx::ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<ClockWidgetController>
     {
         Q_OBJECT
 
@@ -88,10 +88,6 @@ namespace armarx
          * Returns the Widget name displayed in the ArmarXGui to create an
          * instance of this class.
          */
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Clock";
@@ -141,10 +137,6 @@ namespace armarx
 
         // ArmarXWidgetController interface
     public:
-        virtual QIcon getWidgetIcon() const override
-        {
-            return GetWidgetIcon();
-        }
         static QIcon GetWidgetIcon()
         {
             return QIcon(":icons/Time-And-Date-Clock-icon.png");
diff --git a/source/ArmarXGui/gui-plugins/ConditionViewerPlugin/ConditionViewerWidgetController.h b/source/ArmarXGui/gui-plugins/ConditionViewerPlugin/ConditionViewerWidgetController.h
index 1202697d..7f49241e 100644
--- a/source/ArmarXGui/gui-plugins/ConditionViewerPlugin/ConditionViewerWidgetController.h
+++ b/source/ArmarXGui/gui-plugins/ConditionViewerPlugin/ConditionViewerWidgetController.h
@@ -51,7 +51,7 @@ namespace armarx
     * \see ConditionViewerGuiPlugin
     */
     class ARMARXCOMPONENT_IMPORT_EXPORT ConditionViewerWidgetController :
-        public ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<ConditionViewerWidgetController>
     {
         Q_OBJECT
     public:
@@ -65,10 +65,6 @@ namespace armarx
 
         // inherited from ArmarXWidget
         QPointer<QWidget> getWidget();
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Observers.ConditionViewer";
diff --git a/source/ArmarXGui/gui-plugins/IceProxy/IceProxyWidgetController.h b/source/ArmarXGui/gui-plugins/IceProxy/IceProxyWidgetController.h
index 10f250de..c31101cc 100644
--- a/source/ArmarXGui/gui-plugins/IceProxy/IceProxyWidgetController.h
+++ b/source/ArmarXGui/gui-plugins/IceProxy/IceProxyWidgetController.h
@@ -54,7 +54,7 @@ namespace armarx
      */
     class ARMARXCOMPONENT_IMPORT_EXPORT
         IceProxyWidgetController:
-    public armarx::ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<IceProxyWidgetController>
     {
         Q_OBJECT
 
@@ -72,21 +72,17 @@ namespace armarx
         /**
          * @see ArmarXWidgetController::loadSettings()
          */
-        virtual void loadSettings(QSettings* settings){}
+        virtual void loadSettings(QSettings* settings) {}
 
         /**
          * @see ArmarXWidgetController::saveSettings()
          */
-        virtual void saveSettings(QSettings* settings){}
+        virtual void saveSettings(QSettings* settings) {}
 
         /**
          * Returns the Widget name displayed in the ArmarXGui to create an
          * instance of this class.
          */
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Meta.IceProxy";
@@ -100,15 +96,15 @@ namespace armarx
         /**
          * \see armarx::Component::onConnectComponent()
          */
-        virtual void onConnectComponent(){}
+        virtual void onConnectComponent() {}
 
-            void loadProxy(Ice::ObjectPrx prx);
+        void loadProxy(Ice::ObjectPrx prx);
 
-        private slots:
-            void on_pushButtonFinder_clicked();
-            void on_pushButtonString_clicked();
+    private slots:
+        void on_pushButtonFinder_clicked();
+        void on_pushButtonString_clicked();
 
-        private:
+    private:
         /**
          * Widget Form
          */
diff --git a/source/ArmarXGui/gui-plugins/LoggingPlugin/ArmarXLogViewer/LogViewer.h b/source/ArmarXGui/gui-plugins/LoggingPlugin/ArmarXLogViewer/LogViewer.h
index da2f5a09..718adf3c 100644
--- a/source/ArmarXGui/gui-plugins/LoggingPlugin/ArmarXLogViewer/LogViewer.h
+++ b/source/ArmarXGui/gui-plugins/LoggingPlugin/ArmarXLogViewer/LogViewer.h
@@ -51,7 +51,7 @@ namespace armarx
       \see LoggingPlugin
      */
     class ARMARXCOMPONENT_IMPORT_EXPORT LogViewer :
-        public ArmarXComponentWidgetController,
+        public ArmarXComponentWidgetControllerTemplate<LogViewer>,
         public Log
     {
         Q_OBJECT
@@ -62,18 +62,6 @@ namespace armarx
 
         void loadSettings(QSettings* settings);
         void saveSettings(QSettings* settings);
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
-        virtual QIcon getWidgetIcon() const override
-        {
-            return GetWidgetIcon();
-        }
-        virtual QIcon getWidgetCategoryIcon() const override
-        {
-            return GetWidgetCategoryIcon();
-        }
         static QString GetWidgetName()
         {
             return "Meta.LogViewer";
diff --git a/source/ArmarXGui/gui-plugins/ObserverPropertiesPlugin/ObserverWidgetController.h b/source/ArmarXGui/gui-plugins/ObserverPropertiesPlugin/ObserverWidgetController.h
index 32152190..041c05d2 100644
--- a/source/ArmarXGui/gui-plugins/ObserverPropertiesPlugin/ObserverWidgetController.h
+++ b/source/ArmarXGui/gui-plugins/ObserverPropertiesPlugin/ObserverWidgetController.h
@@ -48,7 +48,7 @@ namespace armarx
      * Channels show their offered datafields with their type, current value and an live plot.
      * It is also possible to install filters for each datafield by right-clicking on the datafield and selecting
      * the desired filter.
-     * \see \ref Observers 
+     * \see \ref Observers
      * \see \ref ObserverWidgetController
      */
 
@@ -56,7 +56,7 @@ namespace armarx
      * \class ObserverWidgetController
      */
     class ARMARXCOMPONENT_IMPORT_EXPORT ObserverWidgetController :
-        public ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<ObserverWidgetController>
     {
         Q_OBJECT
     public:
@@ -69,18 +69,6 @@ namespace armarx
 
         // inherited from ArmarXWidget
         QPointer<QWidget> getWidget();
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
-        virtual QIcon getWidgetIcon() const override
-        {
-            return GetWidgetIcon();
-        }
-        virtual QIcon getWidgetCategoryIcon() const override
-        {
-            return GetWidgetCategoryIcon();
-        }
         static QString GetWidgetName()
         {
             return "Observers.ObserverView";
diff --git a/source/ArmarXGui/gui-plugins/PlotterPlugin/ArmarXPlotter.cpp b/source/ArmarXGui/gui-plugins/PlotterPlugin/ArmarXPlotter.cpp
index 57e25342..d156d3df 100644
--- a/source/ArmarXGui/gui-plugins/PlotterPlugin/ArmarXPlotter.cpp
+++ b/source/ArmarXGui/gui-plugins/PlotterPlugin/ArmarXPlotter.cpp
@@ -50,13 +50,9 @@ using namespace std;
 
 namespace armarx
 {
-
     ArmarXPlotter::ArmarXPlotter() :
-        ArmarXComponentWidgetController(),
         startUpTime(QDateTime::currentDateTime())
     {
-
-
         plotterController = QSharedPointer<PlotterController>::create();
         setTag("Plotter");
         ui.setupUi(getWidget());
@@ -66,7 +62,6 @@ namespace armarx
 
         plotterController->setGraphStyle(ui.CBgraphStyle->currentIndex());
         ui.verticalLayout->insertWidget(0, plotterController->getPlotterWidget());
-
     }
 
     ArmarXPlotter::~ArmarXPlotter()
@@ -74,19 +69,9 @@ namespace armarx
         //        if(dialog && this->getState() == eManagedIceObjectInitialized)
         //            getArmarXManager()->removeObjectNonBlocking(dialog);
         //        delete dialog;
-
     }
 
-
-
-
-
-
-
-    void ArmarXPlotter::onInitComponent()
-    {
-
-    }
+    void ArmarXPlotter::onInitComponent() {}
 
     void ArmarXPlotter::onConnectComponent()
     {
@@ -108,16 +93,12 @@ namespace armarx
             ARMARX_WARNING << "Failed to invoke setupCurves";
         }
 
-
         usingTopic("TopicReplayerListener");
-
     }
 
-
     void ArmarXPlotter::onExitComponent()
     {
         //        unsubscribeFromTopic("TopicReplayerListener");
-
         plotterController.clear();
     }
 
@@ -216,7 +197,7 @@ namespace armarx
                 csvHeader = plotterController->getSelectedDatafieldsKeys();
 
                 logstream << "Timestamp";
-                for (const auto & s : csvHeader)
+                for (const auto& s : csvHeader)
                 {
                     logstream <<  "," << s;
                 }
@@ -265,8 +246,6 @@ namespace armarx
         }
     }
 
-
-
     void ArmarXPlotter::saveSettings(QSettings* settings)
     {
         ScopedLock lock(dataMutex);
@@ -292,8 +271,6 @@ namespace armarx
         ARMARX_VERBOSE << "Settings loaded";
     }
 
-
-
     void ArmarXPlotter::logToFile(long timestamp, const std::map<std::string, VariantPtr>& dataMaptoAppend)
     {
         std::lock_guard<std::mutex> lock(fileMutex);
@@ -313,10 +290,6 @@ namespace armarx
                 logstream << dataMaptoAppend.at(f)->Variant::getOutputValueOnly();
             }
         }
-
         logstream  << std::endl;
     }
-
-
-
 }
diff --git a/source/ArmarXGui/gui-plugins/PlotterPlugin/ArmarXPlotter.h b/source/ArmarXGui/gui-plugins/PlotterPlugin/ArmarXPlotter.h
index 0a4c57a0..450b57a0 100644
--- a/source/ArmarXGui/gui-plugins/PlotterPlugin/ArmarXPlotter.h
+++ b/source/ArmarXGui/gui-plugins/PlotterPlugin/ArmarXPlotter.h
@@ -61,9 +61,6 @@ class QwtPlotMarker;
 
 namespace armarx
 {
-
-
-
     class ArmarXPlotterDialog;
     /*!
      * \page ArmarXGui-GuiPlugins-PlotterPlugin Live Plotter
@@ -73,14 +70,12 @@ namespace armarx
       */
     class ARMARXCOMPONENT_IMPORT_EXPORT
         ArmarXPlotter:
-        public ArmarXComponentWidgetController,
+        public ArmarXComponentWidgetControllerTemplate<ArmarXPlotter>,
         public TopicReplayerListenerInterface
 
     {
         Q_OBJECT
     public:
-
-
         void onStartReplay(const std::string& filename, const Ice::Current& c = Ice::Current())
         {
             if (!syncDataLogging)
@@ -116,7 +111,6 @@ namespace armarx
             }
         }
 
-
         Ui::ArmarXPlotter ui;
         QPointer<ArmarXPlotterDialog> dialog;
         QTimer* timer;
@@ -127,14 +121,6 @@ namespace armarx
         explicit ArmarXPlotter();
         ~ArmarXPlotter();
         //inherited from ArmarXWidget
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
-        virtual QIcon getWidgetIcon() const override
-        {
-            return GetWidgetIcon();
-        }
         static QString GetWidgetName()
         {
             return "Observers.LivePlotter";
@@ -147,14 +133,11 @@ namespace armarx
         void saveSettings(QSettings* settings);
         //for AbstractFactoryMethod class
 
-
         // inherited from Component
         virtual void onInitComponent();
         virtual void onConnectComponent();
         virtual void onExitComponent();
 
-
-
         /**
         * emits the closeRequest signal
         */
@@ -182,8 +165,6 @@ namespace armarx
         bool __plottingPaused;
         JSONObjectPtr json;
 
-
-
         Mutex dataMutex;
         bool syncDataLogging;
         std::vector<std::string> csvHeader;
@@ -193,14 +174,9 @@ namespace armarx
 
         std::mutex mutex;
 
-
         std::mutex fileMutex;
 
         QSharedPointer<PlotterController> plotterController;
-
-
     };
-
 }
-
 #endif
diff --git a/source/ArmarXGui/gui-plugins/PlotterPlugin/StaticPlotterWidgetController.h b/source/ArmarXGui/gui-plugins/PlotterPlugin/StaticPlotterWidgetController.h
index 2ea7be5e..727cedc2 100644
--- a/source/ArmarXGui/gui-plugins/PlotterPlugin/StaticPlotterWidgetController.h
+++ b/source/ArmarXGui/gui-plugins/PlotterPlugin/StaticPlotterWidgetController.h
@@ -37,7 +37,7 @@ namespace armarx
            The GUI needs to be running before the plot is sent.
           */
     class StaticPlotterWidgetController :
-        public ArmarXComponentWidgetController,
+        public ArmarXComponentWidgetControllerTemplate<StaticPlotterWidgetController>,
         public StaticPlotterInterface
     {
         Q_OBJECT
@@ -59,10 +59,6 @@ namespace armarx
         void showCurve(QwtPlotItem* item, bool on);
         void clearPlots();
     public:
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Util.Plotter";
@@ -74,15 +70,14 @@ namespace armarx
     private:
         QwtPlotCurve* createCurve(const QString& label, QColor color);
 
-
         Ui::StaticPlotterWidget ui;
         QPointer<QwtPlot> plotter;
         std::map<QString, StringVector2fSeqDict > plotsMap;
         Mutex dataMutex;
         QToolBar* customToolbar;
 
-//        StaticPlotterInterfacePrx topicPrx ;
-//        armarx::SimpleRunningTask<>::pointer_type task;
+        //        StaticPlotterInterfacePrx topicPrx ;
+        //        armarx::SimpleRunningTask<>::pointer_type task;
 
         // StaticPlotterInterface interface
     public:
diff --git a/source/ArmarXGui/gui-plugins/ScenarioManager/ScenarioManagerWidgetController.h b/source/ArmarXGui/gui-plugins/ScenarioManager/ScenarioManagerWidgetController.h
index 291ee81f..31217d32 100644
--- a/source/ArmarXGui/gui-plugins/ScenarioManager/ScenarioManagerWidgetController.h
+++ b/source/ArmarXGui/gui-plugins/ScenarioManager/ScenarioManagerWidgetController.h
@@ -61,7 +61,7 @@ namespace armarx
      */
     class ARMARXCOMPONENT_IMPORT_EXPORT
         ScenarioManagerWidgetController:
-    public armarx::ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<ScenarioManagerWidgetController>
     {
         Q_OBJECT
 
@@ -90,10 +90,6 @@ namespace armarx
          * Returns the Widget name displayed in the ArmarXGui to create an
          * instance of this class.
          */
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Meta.ScenarioManager";
@@ -150,10 +146,6 @@ namespace armarx
         QPointer<QWidget> getCustomTitlebarWidget(QWidget* parent);
         // ArmarXWidgetController interface
     public:
-        virtual QIcon getWidgetIcon() const override
-        {
-            return GetWidgetIcon();
-        }
         static QIcon GetWidgetIcon()
         {
             return QIcon(":icons/ArmarX_Play_Store.svg");
diff --git a/source/ArmarXGui/gui-plugins/StatechartEditorPlugin/StatechartEditorController.h b/source/ArmarXGui/gui-plugins/StatechartEditorPlugin/StatechartEditorController.h
index 9ec7e2e2..f3cb92bd 100644
--- a/source/ArmarXGui/gui-plugins/StatechartEditorPlugin/StatechartEditorController.h
+++ b/source/ArmarXGui/gui-plugins/StatechartEditorPlugin/StatechartEditorController.h
@@ -131,7 +131,7 @@ namespace armarx
       \brief The StatechartEditorController class is the controller of the main widget of the Statechart Editor.
      */
     class StatechartEditorController :
-        public ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<StatechartEditorController>
     {
         Q_OBJECT
 
@@ -167,22 +167,10 @@ namespace armarx
         void onExitComponent();
 
         // inherited of ArmarXWidget
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Statecharts.StatechartEditor";
         }
-        virtual QIcon getWidgetIcon() const override
-        {
-            return GetWidgetIcon();
-        }
-        virtual QIcon getWidgetCategoryIcon() const override
-        {
-            return GetWidgetCategoryIcon();
-        }
         static QIcon GetWidgetIcon()
         {
             return QIcon(":/statechart-editor/states.svg");
diff --git a/source/ArmarXGui/gui-plugins/StatechartEventSenderPlugin/EventSenderOverview.cpp b/source/ArmarXGui/gui-plugins/StatechartEventSenderPlugin/EventSenderOverview.cpp
index 3e627329..f981676c 100644
--- a/source/ArmarXGui/gui-plugins/StatechartEventSenderPlugin/EventSenderOverview.cpp
+++ b/source/ArmarXGui/gui-plugins/StatechartEventSenderPlugin/EventSenderOverview.cpp
@@ -32,7 +32,6 @@ using namespace armarx;
 
 
 EventSenderOverview::EventSenderOverview() :
-    ArmarXComponentWidgetController(),
     ui(new Ui::EventSenderOverview())
 
 {
@@ -47,8 +46,6 @@ EventSenderOverview::~EventSenderOverview()
     delete ui;
 }
 
-
-
 void EventSenderOverview::loadSettings(QSettings* settings)
 {
     int size = settings->beginReadArray("EventSender");
@@ -86,10 +83,8 @@ void EventSenderOverview::saveSettings(QSettings* settings)
     }
 
     settings->endArray();
-
 }
 
-
 void EventSenderOverview::onInitComponent()
 {
     int size = ui->scrollAreaWidgetContents->children().size();
@@ -187,10 +182,4 @@ void EventSenderOverview::sendEvent(const EventSenderConfig& config)
     {
         ARMARX_WARNING << "Cannot send event - caught exception:\n" << e.what();
     }
-
-
 }
-
-
-
-
diff --git a/source/ArmarXGui/gui-plugins/StatechartEventSenderPlugin/EventSenderOverview.h b/source/ArmarXGui/gui-plugins/StatechartEventSenderPlugin/EventSenderOverview.h
index 29fba0d8..e345a9a2 100644
--- a/source/ArmarXGui/gui-plugins/StatechartEventSenderPlugin/EventSenderOverview.h
+++ b/source/ArmarXGui/gui-plugins/StatechartEventSenderPlugin/EventSenderOverview.h
@@ -127,7 +127,7 @@ namespace armarx
      * \see StatechartEventSenderPlugin
      */
     class EventSenderOverview :
-        public ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<EventSenderOverview>
 
     {
         Q_OBJECT
@@ -138,10 +138,6 @@ namespace armarx
         ~EventSenderOverview();
 
         //inherited from ArmarXWidget
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Statecharts.EventSender";
@@ -151,7 +147,7 @@ namespace armarx
         void saveSettings(QSettings* settings);
         // inherited from Component
         virtual void onInitComponent();
-        virtual void onConnectComponent() {};
+        virtual void onConnectComponent() {}
         // end of inherited from Component
         // end of inherited from Component
         EventSenderComponent* addEventSender(const EventSenderConfig& config);
diff --git a/source/ArmarXGui/gui-plugins/StatechartViewerPlugin/StatechartViewerController.h b/source/ArmarXGui/gui-plugins/StatechartViewerPlugin/StatechartViewerController.h
index 4ede8cce..c6a3c2c3 100644
--- a/source/ArmarXGui/gui-plugins/StatechartViewerPlugin/StatechartViewerController.h
+++ b/source/ArmarXGui/gui-plugins/StatechartViewerPlugin/StatechartViewerController.h
@@ -54,7 +54,7 @@ namespace armarx
      \see StatechartViewerGuiPlugin
     */
     class StatechartViewerController :
-        public ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<StatechartViewerController>
     {
         Q_OBJECT
 
@@ -68,14 +68,6 @@ namespace armarx
         void onExitComponent();
 
         // inherited of ArmarXWidget
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
-        virtual QIcon getWidgetIcon() const override
-        {
-            return GetWidgetIcon();
-        }
         static QString GetWidgetName()
         {
             return "Statecharts.StatechartViewer";
diff --git a/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/IceGridViewer/IceGridViewer.h b/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/IceGridViewer/IceGridViewer.h
index a3bff244..bf5116f7 100644
--- a/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/IceGridViewer/IceGridViewer.h
+++ b/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/IceGridViewer/IceGridViewer.h
@@ -56,7 +56,7 @@ namespace armarx
      * \class IceGridViewer
      */
     class IceGridViewer :
-        public ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<IceGridViewer>
     {
         Q_OBJECT
 
@@ -78,10 +78,6 @@ namespace armarx
          * Returns the Widget name displayed in the ArmarXGui to create an
          * instance of this.
          */
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Meta.IceGridViewer";
diff --git a/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/SystemStateMonitorWidget.h b/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/SystemStateMonitorWidget.h
index 97761593..a2fc22f6 100644
--- a/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/SystemStateMonitorWidget.h
+++ b/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/SystemStateMonitorWidget.h
@@ -67,7 +67,7 @@ namespace armarx
       */
     class ARMARXCOMPONENT_IMPORT_EXPORT
         SystemStateMonitorWidget:
-    public ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<SystemStateMonitorWidget>
     {
         Q_OBJECT
 
@@ -100,10 +100,6 @@ namespace armarx
          * Returns the Widget name displayed in the ArmarXGui to create an
          * instance of this.
          */
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Meta.SystemStateMonitor";
@@ -200,10 +196,6 @@ namespace armarx
 
         // ArmarXWidgetController interface
     public:
-        virtual QIcon getWidgetIcon() const override
-        {
-            return GetWidgetIcon();
-        }
         static QIcon GetWidgetIcon()
         {
             return QIcon(":icons/activity_monitor.png");
diff --git a/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/ThreadViewer/ThreadViewer.h b/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/ThreadViewer/ThreadViewer.h
index 6760e9ca..2c9a1f4c 100644
--- a/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/ThreadViewer/ThreadViewer.h
+++ b/source/ArmarXGui/gui-plugins/SystemStateMonitorPlugin/ThreadViewer/ThreadViewer.h
@@ -54,7 +54,7 @@ namespace armarx
      * \class ThreadViewer
      * \brief The ThreadViewer displays all threads of an ArmarX application.
      */
-    class ThreadViewer : public ArmarXComponentWidgetController
+    class ThreadViewer : public ArmarXComponentWidgetControllerTemplate<ThreadViewer>
     {
         Q_OBJECT
 
@@ -76,14 +76,6 @@ namespace armarx
          * Returns the Widget name displayed in the ArmarXGui to create an
          * instance of this.
          */
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
-        virtual QIcon getWidgetIcon() const override
-        {
-            return GetWidgetIcon();
-        }
         static QString GetWidgetName()
         {
             return "Meta.ThreadViewer";
diff --git a/source/ArmarXGui/gui-plugins/TopicReplayerPlugin/TopicReplayerWidgetController.h b/source/ArmarXGui/gui-plugins/TopicReplayerPlugin/TopicReplayerWidgetController.h
index 0021176b..e3cf83db 100644
--- a/source/ArmarXGui/gui-plugins/TopicReplayerPlugin/TopicReplayerWidgetController.h
+++ b/source/ArmarXGui/gui-plugins/TopicReplayerPlugin/TopicReplayerWidgetController.h
@@ -62,7 +62,7 @@ namespace armarx
      */
     class ARMARXCOMPONENT_IMPORT_EXPORT
         TopicReplayerWidgetController:
-    public armarx::ArmarXComponentWidgetController
+        public ArmarXComponentWidgetControllerTemplate<TopicReplayerWidgetController>
     {
         Q_OBJECT
 
@@ -91,10 +91,6 @@ namespace armarx
          * Returns the Widget name displayed in the ArmarXGui to create an
          * instance of this class.
          */
-        virtual QString getWidgetName() const override
-        {
-            return GetWidgetName();
-        }
         static QString GetWidgetName()
         {
             return "Meta.TopicReplayer";
@@ -110,7 +106,6 @@ namespace armarx
          */
         virtual void onConnectComponent();
 
-
     public slots:
         /* QT slot declarations */
 
-- 
GitLab