Browse Source

Add the path to the Qt designer plugins to the ui loader.

Sascha Zelzer 12 years ago
parent
commit
b023d87b67
1 changed files with 8 additions and 0 deletions
  1. 8 0
      Libs/CommandLineModules/QtGui/ctkCmdLineModuleQtGui.cpp

+ 8 - 0
Libs/CommandLineModules/QtGui/ctkCmdLineModuleQtGui.cpp

@@ -28,6 +28,7 @@
 #include <QUiLoader>
 #include <QWidget>
 #include <QVariant>
+#include <QCoreApplication>
 
 #include <QDebug>
 
@@ -55,6 +56,13 @@ QObject* ctkCmdLineModuleQtGui::guiHandle() const
   }
 
   QUiLoader uiLoader;
+#ifdef CMAKE_INTDIR
+  QString appPath = QCoreApplication::applicationDirPath();
+  if (appPath.endsWith(CMAKE_INTDIR))
+  {
+    uiLoader.addPluginPath(appPath + "/../designer");
+  }
+#endif
   WidgetTree = uiLoader.load(&uiForm);
   return WidgetTree;
 }