Procházet zdrojové kódy

Update CTKWidget PythonQt decorator to fix build error following Qt5 transition

This commit fixes build error introduced by f49c19a when moving
ctkErrorLogModel from Core to Widget library.
Jean-Christophe Fillion-Robin před 11 roky
rodič
revize
c927e3fb56

+ 0 - 13
Libs/Core/ctkCorePythonQtDecorators.h

@@ -25,7 +25,6 @@
 #include <PythonQt.h>
 #include <PythonQt.h>
 
 
 // CTK includes
 // CTK includes
-#include <ctkErrorLogModel.h>
 #include <ctkWorkflowStep.h>
 #include <ctkWorkflowStep.h>
 #include <ctkWorkflowTransitions.h>
 #include <ctkWorkflowTransitions.h>
 
 
@@ -161,23 +160,11 @@ public Q_SLOTS:
     {
     {
     delete transition;
     delete transition;
     }
     }
-
-  // ctkErrorLogLevel
-
-  QString static_ctkErrorLogLevel_logLevelAsString(ctkErrorLogLevel::LogLevel logLevel)
-    {
-    return ctkErrorLogLevel::logLevelAsString(logLevel);
-    }
 };
 };
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 void initCTKCorePythonQtDecorators()
 void initCTKCorePythonQtDecorators()
 {
 {
-  // HACK: Since the CMake based light wrapping only consider class name matching the
-  //       filename where the class is defined, let's explicitly register ctkErrorLogLevel
-  //       so that the log level QFlags are exposed to python.
-  PythonQt::self()->registerClass(&ctkErrorLogLevel::staticMetaObject, "CTKCore");
-
   PythonQt::self()->addDecorators(new ctkCorePythonQtDecorators);
   PythonQt::self()->addDecorators(new ctkCorePythonQtDecorators);
 }
 }
 
 

+ 13 - 0
Libs/Widgets/ctkWidgetsPythonQtDecorators.h

@@ -25,6 +25,7 @@
 #include <PythonQt.h>
 #include <PythonQt.h>
 
 
 // CTK includes
 // CTK includes
+#include <ctkErrorLogModel.h>
 #include <ctkWorkflowWidgetStep.h>
 #include <ctkWorkflowWidgetStep.h>
 
 
 // NOTE:
 // NOTE:
@@ -69,12 +70,24 @@ public Q_SLOTS:
     {
     {
     step->setHasShowUserInterfaceCommand(newHasShowUserInterfaceCommand);
     step->setHasShowUserInterfaceCommand(newHasShowUserInterfaceCommand);
     }
     }
+
+  // ctkErrorLogLevel
+
+  QString static_ctkErrorLogLevel_logLevelAsString(ctkErrorLogLevel::LogLevel logLevel)
+    {
+    return ctkErrorLogLevel::logLevelAsString(logLevel);
+    }
 };
 };
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 /// \ingroup Widgets
 /// \ingroup Widgets
 void initCTKWidgetsPythonQtDecorators()
 void initCTKWidgetsPythonQtDecorators()
 {
 {
+  // HACK: Since the CMake based light wrapping only consider class name matching the
+  //       filename where the class is defined, let's explicitly register ctkErrorLogLevel
+  //       so that the log level QFlags are exposed to python.
+  PythonQt::self()->registerClass(&ctkErrorLogLevel::staticMetaObject, "CTKCore");
+
   PythonQt::self()->addDecorators(new ctkWidgetsPythonQtDecorators);
   PythonQt::self()->addDecorators(new ctkWidgetsPythonQtDecorators);
 }
 }