소스 검색

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 14 년 전
부모
커밋
8e971ab3a5
1개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. 11 2
      Applications/ctkSimplePythonShell/ctkSimplePythonQtDecorators.h

+ 11 - 2
Applications/ctkSimplePythonShell/ctkSimplePythonQtDecorators.h

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