I plan to 'manually expand' the current uses QController as in the
attached patch.

The result is not only shorter but also simpler. No need for a template
with a template argument (QController) anymore.

Maybe I'll arrive at a point where I understand the code at some time...

Andre'
Index: GuiERT.h
===================================================================
--- GuiERT.h    (revision 19953)
+++ GuiERT.h    (working copy)
@@ -14,6 +14,7 @@
 
 #include "GuiDialogView.h"
 #include "ui_ERTUi.h"
+#include "controllers/ControlERT.h"
 
 #include <QCloseEvent>
 #include <QDialog>
@@ -36,16 +37,16 @@
 };
 
 
-
-class ControlERT;
-
-class GuiERT : public QController<ControlERT, GuiView<GuiERTDialog> >
-{
+class GuiERT : public GuiView<GuiERTDialog> {
 public:
-       friend class GuiERTDialog;
-
+       /// constructor
        GuiERT(Dialog &);
+       ControlERT & controller()
+       { return static_cast<ControlERT &>(this->getController()); }
+       ControlERT const & controller() const
+       { return static_cast<ControlERT const &>(this->getController()); }
 private:
+       friend class GuiERTDialog;
        /// Apply changes
        virtual void apply();
        /// update
Index: GuiERT.cpp
===================================================================
--- GuiERT.cpp  (revision 19953)
+++ GuiERT.cpp  (working copy)
@@ -13,8 +13,6 @@
 #include "GuiERT.h"
 #include "Qt2BC.h"
 
-#include "controllers/ControlERT.h"
-
 #include <QRadioButton>
 #include <QPushButton>
 #include <QCloseEvent>
@@ -60,11 +58,8 @@
 //
 /////////////////////////////////////////////////////////////////////
 
-typedef QController<ControlERT, GuiView<GuiERTDialog> > ERTBase;
-
-
 GuiERT::GuiERT(Dialog & parent)
-       : ERTBase(parent, _("TeX Code Settings"))
+       : GuiView<GuiERTDialog>(parent, _("TeX Code Settings"))
 {
 }
 

Reply via email to