Sfoglia il codice sorgente

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 11 anni fa
parent
commit
c927e3fb56

+ 0 - 13
Libs/Core/ctkCorePythonQtDecorators.h

@@ -25,7 +25,6 @@
 #include <PythonQt.h>
 
 // CTK includes
-#include <ctkErrorLogModel.h>
 #include <ctkWorkflowStep.h>
 #include <ctkWorkflowTransitions.h>
 
@@ -161,23 +160,11 @@ public Q_SLOTS:
     {
     delete transition;
     }
-
-  // ctkErrorLogLevel
-
-  QString static_ctkErrorLogLevel_logLevelAsString(ctkErrorLogLevel::LogLevel logLevel)
-    {
-    return ctkErrorLogLevel::logLevelAsString(logLevel);
-    }
 };
 
 //-----------------------------------------------------------------------------
 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);
 }
 

+ 13 - 0
Libs/Widgets/ctkWidgetsPythonQtDecorators.h

@@ -25,6 +25,7 @@
 #include <PythonQt.h>
 
 // CTK includes
+#include <ctkErrorLogModel.h>
 #include <ctkWorkflowWidgetStep.h>
 
 // NOTE:
@@ -69,12 +70,24 @@ public Q_SLOTS:
     {
     step->setHasShowUserInterfaceCommand(newHasShowUserInterfaceCommand);
     }
+
+  // ctkErrorLogLevel
+
+  QString static_ctkErrorLogLevel_logLevelAsString(ctkErrorLogLevel::LogLevel logLevel)
+    {
+    return ctkErrorLogLevel::logLevelAsString(logLevel);
+    }
 };
 
 //-----------------------------------------------------------------------------
 /// \ingroup Widgets
 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);
 }