Quellcode durchsuchen

ctkSimplePythonQtDecorator - Conditionally include dependent decorators

This will solve the compilation error happening when
ctkSimplePythonshell is built with CTK_WRAP_PYTHONQT_LIGHT OFF
Jean-Christophe Fillion-Robin vor 14 Jahren
Ursprung
Commit
8e971ab3a5
1 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen
  1. 11 2
      Applications/ctkSimplePythonShell/ctkSimplePythonQtDecorators.h

+ 11 - 2
Applications/ctkSimplePythonShell/ctkSimplePythonQtDecorators.h

@@ -3,9 +3,14 @@
 #define __ctkSimplePythonQtDecorators_h
 #define __ctkSimplePythonQtDecorators_h
 
 
 // CTK includes
 // CTK includes
+#include "ctkSimplePythonShellConfigure.h" // For CTK_WRAP_PYTHONQT_LIGHT
 #include <ctkAbstractPythonManager.h>
 #include <ctkAbstractPythonManager.h>
-#include <ctkCorePythonQtDecorators.h>
-#include <ctkWidgetsPythonQtDecorators.h>
+#ifdef CTK_WRAP_PYTHONQT_LIGHT
+# include <ctkCorePythonQtDecorators.h>
+# include <ctkWidgetsPythonQtDecorators.h>
+#endif
+
+// PythonQt includes
 #include <PythonQt.h>
 #include <PythonQt.h>
 
 
 // NOTE:
 // NOTE:
@@ -24,8 +29,12 @@ public:
   ctkSimplePythonQtDecorators(ctkAbstractPythonManager* pythonManager)
   ctkSimplePythonQtDecorators(ctkAbstractPythonManager* pythonManager)
     {
     {
     Q_ASSERT(pythonManager);
     Q_ASSERT(pythonManager);
+#ifdef CTK_WRAP_PYTHONQT_LIGHT
     pythonManager->registerPythonQtDecorator(new ctkCorePythonQtDecorators);
     pythonManager->registerPythonQtDecorator(new ctkCorePythonQtDecorators);
     pythonManager->registerPythonQtDecorator(new ctkWidgetsPythonQtDecorators);
     pythonManager->registerPythonQtDecorator(new ctkWidgetsPythonQtDecorators);
+#else
+    Q_UNUSED(pythonManager);
+#endif
     }
     }
 
 
 public slots:
 public slots: