Quellcode durchsuchen

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 vor 11 Jahren
Ursprung
Commit
c927e3fb56
2 geänderte Dateien mit 13 neuen und 13 gelöschten Zeilen
  1. 0 13
      Libs/Core/ctkCorePythonQtDecorators.h
  2. 13 0
      Libs/Widgets/ctkWidgetsPythonQtDecorators.h

+ 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);
 }