Selaa lähdekoodia

Make more libs and apps compatible with Qt5.

Sascha Zelzer 11 vuotta sitten
vanhempi
commit
d6f12b0038
78 muutettua tiedostoa jossa 278 lisäystä ja 137 poistoa
  1. 7 3
      Applications/Testing/Cpp/CMakeLists.txt
  2. 4 2
      Applications/ctkCommandLineModuleExplorer/CMakeLists.txt
  3. 14 6
      Applications/ctkCommandLineModuleExplorer/ctkCmdLineModuleExplorerMainWindow.cpp
  4. 1 2
      Applications/ctkDICOMIndexer/ctkDICOMIndexerMain.cpp
  5. 5 5
      Applications/ctkDICOMObjectViewer/ctkDICOMObjectViewerMain.cpp
  6. 3 3
      Applications/ctkDICOMQuery/ctkDICOMQueryMain.cpp
  7. 7 7
      Applications/ctkDICOMRetrieve/ctkDICOMRetrieveMain.cpp
  8. 4 0
      Applications/ctkExampleHost/CMakeLists.txt
  9. 4 4
      Applications/ctkExampleHost/ctkExampleHostMain.cpp
  10. 1 1
      Applications/ctkExampleHost/ctkHostAppExampleWidget.cpp
  11. 4 0
      Applications/ctkPluginBrowser/CMakeLists.txt
  12. 2 2
      Applications/ctkPluginBrowser/ctkPluginTableModel.cpp
  13. 1 0
      CMake/ctkBlockCheckDependencies.cmake
  14. 1 1
      CMake/ctkMacroBuildApp.cmake
  15. 1 1
      CMake/ctkMacroBuildLib.cmake
  16. 1 1
      CMake/ctkMacroBuildPlugin.cmake
  17. 1 1
      CMake/ctkMacroBuildQtPlugin.cmake
  18. 5 2
      CMake/ctkMacroSetupQt.cmake
  19. 2 1
      CMakeExternals/QtSOAP.cmake
  20. 1 0
      CMakeExternals/qRestAPI.cmake
  21. 20 7
      CMakeLists.txt
  22. 1 1
      Libs/Core/Testing/Cpp/ctkDummyPlugin.h
  23. 1 1
      Libs/DICOM/Widgets/Plugins/ctkDICOMWidgetsPlugins.h
  24. 1 1
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA1_test/ctkTestPluginAActivator_p.h
  25. 1 1
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA2_test/ctkTestPluginA2Activator_p.h
  26. 1 1
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA_test/ctkTestPluginAActivator_p.h
  27. 1 1
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL1_test/ctkActivatorSL1_p.h
  28. 1 1
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL3_test/ctkActivatorSL3_p.h
  29. 1 1
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL4_test/ctkActivator_p.h
  30. 6 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginS_test/ctkTestPluginSActivator.cpp
  31. 3 1
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginS_test/ctkTestPluginSActivator_p.h
  32. 1 1
      Libs/PluginFramework/Testing/MetaTypeTestPlugins/pluginAttrPwd_test/ctkTestPluginMTAttrPwdActivator_p.h
  33. 1 1
      Libs/PluginFramework/Testing/org.commontk.configadmintest/ctkConfigAdminTestActivator_p.h
  34. 1 1
      Libs/PluginFramework/Testing/org.commontk.eventadmintest.perf/ctkEventAdminTestPerfActivator_p.h
  35. 1 1
      Libs/PluginFramework/Testing/org.commontk.eventadmintest/ctkEventAdminTestActivator_p.h
  36. 1 1
      Libs/PluginFramework/Testing/org.commontk.metatypetest/ctkMetaTypeTestActivator_p.h
  37. 1 1
      Libs/PluginFramework/Testing/org.commontk.pluginfwtest.perf/ctkPluginFrameworkTestPerfActivator_p.h
  38. 1 1
      Libs/PluginFramework/Testing/org.commontk.pluginfwtest/ctkPluginFrameworkTestActivator_p.h
  39. 1 1
      Libs/Scripting/Python/Widgets/Plugins/ctkScriptingPythonWidgetsPlugins.h
  40. 1 1
      Libs/Visualization/VTK/Widgets/Plugins/ctkVTKWidgetsPlugins.h
  41. 1 1
      Libs/Widgets/Plugins/ctkWidgetsPlugins.h
  42. 1 4
      Libs/Widgets/target_libraries.cmake
  43. 9 1
      Libs/XNAT/Core/Testing/CMakeLists.txt
  44. 9 0
      Libs/XNAT/Core/ctkXnatAPI.cpp
  45. 7 3
      Libs/XNAT/Core/ctkXnatSession.cpp
  46. 4 0
      Libs/XNAT/Widgets/CMakeLists.txt
  47. 2 0
      Plugins/org.commontk.configadmin/ctkConfigurationAdminActivator.cpp
  48. 3 0
      Plugins/org.commontk.configadmin/ctkConfigurationAdminActivator_p.h
  49. 21 10
      Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppLogic.cpp
  50. 3 3
      Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppPlugin.cpp
  51. 3 0
      Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppPlugin_p.h
  52. 4 0
      Plugins/org.commontk.dah.core/CMakeLists.txt
  53. 2 2
      Plugins/org.commontk.dah.core/Testing/Cpp/ctkDicomObjectLocatorCacheTest1.cpp
  54. 3 1
      Plugins/org.commontk.dah.core/ctkDicomAppHostingCorePlugin.cpp
  55. 3 0
      Plugins/org.commontk.dah.core/ctkDicomAppHostingCorePlugin_p.h
  56. 31 31
      Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.cpp
  57. 1 1
      Plugins/org.commontk.dah.core/ctkDicomExchangeService.h
  58. 1 1
      Plugins/org.commontk.dah.core/ctkDicomObjectLocatorCache.cpp
  59. 4 0
      Plugins/org.commontk.dah.core/ctkSimpleSoapServer.cpp
  60. 4 0
      Plugins/org.commontk.dah.core/ctkSimpleSoapServer.h
  61. 2 2
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppPlugin.cpp
  62. 3 0
      Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppPlugin_p.h
  63. 3 3
      Plugins/org.commontk.dah.examplehost/ctkExampleDicomHostPlugin.cpp
  64. 3 0
      Plugins/org.commontk.dah.examplehost/ctkExampleDicomHostPlugin_p.h
  65. 3 3
      Plugins/org.commontk.dah.host/ctkDicomHostPlugin.cpp
  66. 3 0
      Plugins/org.commontk.dah.host/ctkDicomHostPlugin_p.h
  67. 2 0
      Plugins/org.commontk.dah.hostedapp/ctkDicomAppPlugin.cpp
  68. 3 0
      Plugins/org.commontk.dah.hostedapp/ctkDicomAppPlugin_p.h
  69. 2 0
      Plugins/org.commontk.eventadmin/ctkEventAdminActivator.cpp
  70. 3 0
      Plugins/org.commontk.eventadmin/ctkEventAdminActivator_p.h
  71. 2 2
      Plugins/org.commontk.log/ctkLogPlugin.cpp
  72. 3 0
      Plugins/org.commontk.log/ctkLogPlugin_p.h
  73. 2 2
      Plugins/org.commontk.metatype/ctkMetaTypeActivator.cpp
  74. 3 0
      Plugins/org.commontk.metatype/ctkMetaTypeActivator_p.h
  75. 2 0
      Plugins/org.commontk.plugingenerator.core/ctkPluginGeneratorCorePlugin.cpp
  76. 3 0
      Plugins/org.commontk.plugingenerator.core/ctkPluginGeneratorCorePlugin_p.h
  77. 2 0
      Plugins/org.commontk.plugingenerator.ui/ctkPluginGeneratorUiPlugin.cpp
  78. 3 0
      Plugins/org.commontk.plugingenerator.ui/ctkPluginGeneratorUiPlugin_p.h

+ 7 - 3
Applications/Testing/Cpp/CMakeLists.txt

@@ -30,10 +30,14 @@ if(CTK_APP_ctkDICOMQuery AND CTK_APP_ctkDICOMRetrieve)
   # Add Tests
   #
   add_executable(ctkDICOMApplicationTest1 ctkDICOMApplicationTest1.cpp)
-  target_link_libraries(ctkDICOMApplicationTest1 ${QT_LIBRARIES})
+  if(CTK_QT_VERSION VERSION_LESS "5")
+    target_link_libraries(ctkDICOMApplicationTest1 ${QT_LIBRARIES})
+  else()
+    target_link_libraries(ctkDICOMApplicationTest1 Qt5::Core)
+  endif()
 
-  ADD_TEST( NAME ctkDICOMApplicationTest1 
-            COMMAND 
+  ADD_TEST( NAME ctkDICOMApplicationTest1
+            COMMAND
             $<TARGET_FILE:ctkDICOMApplicationTest1>
                ${DCMTK_DCMQRSCP_EXECUTABLE}
                ${DCMQRSCP_CONFIG}

+ 4 - 2
Applications/ctkCommandLineModuleExplorer/CMakeLists.txt

@@ -49,8 +49,10 @@ set(KIT_resources
   resources/ctkCmdLineModuleExplorer.qrc
 )
 
-set(QT_USE_QTUITOOLS 1)
-include(${QT_USE_FILE})
+if(CTK_QT_VERSION VERSION_LESS "5")
+  set(QT_USE_QTUITOOLS 1)
+  include(${QT_USE_FILE})
+endif()
 
 # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
 # The following macro will read the target libraries from the file 'target_libraries.cmake'

+ 14 - 6
Applications/ctkCommandLineModuleExplorer/ctkCmdLineModuleExplorerMainWindow.cpp

@@ -1,22 +1,22 @@
 /*=============================================================================
-  
+
   Library: CTK
-  
+
   Copyright (c) German Cancer Research Center,
     Division of Medical and Biological Informatics
-    
+
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
-  
+
     http://www.apache.org/licenses/LICENSE-2.0
-    
+
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-  
+
 =============================================================================*/
 
 #include "ctkCmdLineModuleExplorerMainWindow.h"
@@ -44,7 +44,11 @@
 #include <ctkSettingsDialog.h>
 
 #include <QtConcurrentMap>
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 #include <QDesktopServices>
+#else
+#include <QStandardPaths>
+#endif
 #include <QMessageBox>
 #include <QFutureSynchronizer>
 #include <QCloseEvent>
@@ -56,7 +60,11 @@ ctkCLModuleExplorerMainWindow::ctkCLModuleExplorerMainWindow(QWidget *parent) :
   QMainWindow(parent),
   ui(new Ui::ctkCmdLineModuleExplorerMainWindow),
   defaultModuleFrontendFactory(NULL),
+  #if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
   moduleManager(ctkCmdLineModuleManager::WEAK_VALIDATION, QDesktopServices::storageLocation(QDesktopServices::CacheLocation)),
+  #else
+  moduleManager(ctkCmdLineModuleManager::WEAK_VALIDATION, QStandardPaths::writableLocation(QStandardPaths::CacheLocation)),
+  #endif
   directoryWatcher(&moduleManager),
   settingsDialog(NULL)
 {

+ 1 - 2
Applications/ctkDICOMIndexer/ctkDICOMIndexerMain.cpp

@@ -19,8 +19,7 @@
 =========================================================================*/
 
 // Qt includes
-#include <QApplication>
-#include <QPushButton>
+#include <QCoreApplication>
 #include <QTextStream>
 
 // CTK includes

+ 5 - 5
Applications/ctkDICOMObjectViewer/ctkDICOMObjectViewerMain.cpp

@@ -34,24 +34,24 @@
 #include <QFileDialog>
 #include <QString>
 
-int main(int argv, char** argc)
+int main(int argc, char** argv)
 {
-  QApplication app(argv, argc);
+  QApplication app(argc, argv);
 
   qApp->setOrganizationName("CTK");
   qApp->setOrganizationDomain("commontk.org");
   qApp->setApplicationName("ctkDICOMObjectViewer");
 
   QString s;
-  if( QApplication::argc() > 1 )
+  if( argc > 1 )
     {
-    s = QApplication::argv()[1];
+    s = argv[1];
     }
   else
     {
     s = QFileDialog::getOpenFileName( 0,
      "Choose an image file", ".",
-     "DCM (*)" 
+     "DCM (*)"
      );
     if( s.size() == 0 )
       {

+ 3 - 3
Applications/ctkDICOMQuery/ctkDICOMQueryMain.cpp

@@ -36,7 +36,7 @@
  */
 
 // Qt includes
-#include <QApplication>
+#include <QCoreApplication>
 #include <QTextStream>
 
 // CTK includes
@@ -80,7 +80,7 @@ int main(int argc, char** argv)
   logger.debug ( "Opening database " + QString ( argv[1] ) );
   myCTK.openDatabase ( argv[1] );
   logger.debug ( "Last error: " + myCTK.lastError() );
-  if ( myCTK.database().isOpen() ) 
+  if ( myCTK.database().isOpen() )
     {
     logger.debug ( "Database is open" );
     }
@@ -89,7 +89,7 @@ int main(int argc, char** argv)
     logger.debug ( "Database is not open" );
     }
 
-  
+
 
   ctkDICOMQuery query;
   query.setCallingAETitle ( QString ( argv[2] ) );

+ 7 - 7
Applications/ctkDICOMRetrieve/ctkDICOMRetrieveMain.cpp

@@ -2,7 +2,7 @@
 
   Library:   CTK
 
-  Copyright (c)  
+  Copyright (c)
 
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
 =========================================================================*/
 
 // Qt includes
-#include <QApplication>
+#include <QCoreApplication>
 #include <QTextStream>
 
 // CTK includes
@@ -65,10 +65,10 @@ int main(int argc, char** argv)
 
   QString StudyUID ( argv[1] );
   QDir OutputDirectory ( argv[2] );
-  QString CallingAETitle ( argv[3] ); 
+  QString CallingAETitle ( argv[3] );
   bool ok;
-  QString CalledAETitle ( argv[4] ); 
-  QString Host ( argv[5] ); 
+  QString CalledAETitle ( argv[4] );
+  QString Host ( argv[5] );
   int CalledPort = QString ( argv[6] ).toInt ( &ok );
   if ( !ok )
     {
@@ -76,7 +76,7 @@ int main(int argc, char** argv)
     print_usage();
     return EXIT_FAILURE;
     }
-  QString MoveDestinationAETitle ( argv[8] ); 
+  QString MoveDestinationAETitle ( argv[8] );
 
   ctkDICOMRetrieve retrieve;
   retrieve.setCallingAETitle ( CallingAETitle );
@@ -85,7 +85,7 @@ int main(int argc, char** argv)
   retrieve.setHost ( Host );
   retrieve.setMoveDestinationAETitle ( MoveDestinationAETitle );
 
-  logger.info ( "StudyUID: " + StudyUID + "\n" 
+  logger.info ( "StudyUID: " + StudyUID + "\n"
                 + "OutputDirectory: " + OutputDirectory.absolutePath() + "\n"
                 + "CallingAETitle: " + CallingAETitle + "\n"
                 + "CalledAEtitle: " + CalledAETitle + "\n"

+ 4 - 0
Applications/ctkExampleHost/CMakeLists.txt

@@ -29,6 +29,10 @@ set(KIT_resources
 # The following macro will read the target libraries from the file 'target_libraries.cmake'
 ctkFunctionGetTargetLibraries(KIT_target_libraries)
 
+if(CTK_QT_VERSION VERSION_GREATER "4")
+  list(APPEND KIT_target_libraries Qt5::Widgets)
+endif()
+
 ctkMacroBuildApp(
   NAME ${PROJECT_NAME}
   SRCS ${KIT_SRCS}

+ 4 - 4
Applications/ctkExampleHost/ctkExampleHostMain.cpp

@@ -46,9 +46,9 @@
 // STD includes
 #include <cstdlib>
 
-int main(int argv, char** argc)
+int main(int argc, char** argv)
 {
-  QApplication app(argv, argc);
+  QApplication app(argc, argv);
 
   qApp->setOrganizationName("CTK");
   qApp->setOrganizationDomain("commontk.org");
@@ -115,9 +115,9 @@ int main(int argv, char** argc)
   QMainWindow mainWindow;
   Ui::MainWindow ui;
   ui.setupUi(&mainWindow);
-  if ( QApplication::argc() > 1 )
+  if ( argc > 1 )
     {
-    ui.controlWidget->setAppFileName(QApplication::argv()[1]);
+    ui.controlWidget->setAppFileName(argv[1]);
     }
 
 //  mainWindow.addDockWidget(static_cast<Qt::DockWidgetArea>(4),new ctkHostAppExampleWidget());

+ 1 - 1
Applications/ctkExampleHost/ctkHostAppExampleWidget.cpp

@@ -23,7 +23,7 @@
 #include <QDebug>
 #include <QFileDialog>
 #include <QProcess>
-#include <QtGui/QVBoxLayout>
+#include <QVBoxLayout>
 
 // CTK includes
 #include "ctkHostAppExampleWidget.h"

+ 4 - 0
Applications/ctkPluginBrowser/CMakeLists.txt

@@ -34,6 +34,10 @@ set(KIT_resources
 # The following macro will read the target libraries from the file 'target_libraries.cmake'
 ctkFunctionGetTargetLibraries(KIT_target_libraries)
 
+if(CTK_QT_VERSION VERSION_GREATER "4")
+  list(APPEND KIT_target_libraries Qt5::Widgets)
+endif()
+
 ctkMacroBuildApp(
   NAME ${PROJECT_NAME}
   SRCS ${KIT_SRCS}

+ 2 - 2
Applications/ctkPluginBrowser/ctkPluginTableModel.cpp

@@ -118,7 +118,7 @@ QString ctkPluginTableModel::getStringForState(const ctkPlugin::State state) con
 
 void ctkPluginTableModel::pluginChanged(const ctkPluginEvent& event)
 {
-  QModelIndex topLeftIndex = createIndex(plugins.indexOf(event.getPlugin()), 0, 0);
-  QModelIndex bottomRightIndex = createIndex(topLeftIndex.row(), columnCount()-1, 0);
+  QModelIndex topLeftIndex = createIndex(plugins.indexOf(event.getPlugin()), 0);
+  QModelIndex bottomRightIndex = createIndex(topLeftIndex.row(), columnCount()-1);
   emit dataChanged(topLeftIndex, bottomRightIndex);
 }

+ 1 - 0
CMake/ctkBlockCheckDependencies.cmake

@@ -45,6 +45,7 @@ if(CTK_SUPERBUILD)
       -DCMAKE_C_FLAGS:STRING=${ep_common_c_flags}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}
       -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
+      -DCMAKE_PREFIX_PATH:STRING=${CMAKE_PREFIX_PATH}
       -DBUILD_TESTING:BOOL=OFF
      )
 endif()

+ 1 - 1
CMake/ctkMacroBuildApp.cmake

@@ -85,7 +85,7 @@ macro(ctkMacroBuildApp)
       # this is a workaround for Visual Studio. The relative include paths in the generated
       # moc files can get very long and can't be resolved by the MSVC compiler.
       foreach(moc_src ${MY_MOC_SRCS})
-        QT5_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src})
+        QT5_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} OPTIONS -DHAVE_QT5)
       endforeach()
     endif()
     QT5_WRAP_UI(MY_UI_CPP ${MY_UI_FORMS})

+ 1 - 1
CMake/ctkMacroBuildLib.cmake

@@ -112,7 +112,7 @@ macro(ctkMacroBuildLib)
     # moc files can get very long and can't be resolved by the MSVC compiler.
     if(CTK_QT_VERSION VERSION_GREATER "4")
       foreach(moc_src ${MY_MOC_SRCS})
-        qt5_wrap_cpp(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src})
+        qt5_wrap_cpp(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} OPTIONS -DHAVE_QT5)
       endforeach()
     else()
       foreach(moc_src ${MY_MOC_SRCS})

+ 1 - 1
CMake/ctkMacroBuildPlugin.cmake

@@ -179,7 +179,7 @@ macro(ctkMacroBuildPlugin)
       # this is a workaround for Visual Studio. The relative include paths in the generated
       # moc files can get very long and can't be resolved by the MSVC compiler.
       foreach(moc_src ${MY_MOC_SRCS})
-        QT5_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src})
+        QT5_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} -DHAVE_QT5)
       endforeach()
     endif()
     QT5_WRAP_UI(MY_UI_CPP ${MY_UI_FORMS})

+ 1 - 1
CMake/ctkMacroBuildQtPlugin.cmake

@@ -85,7 +85,7 @@ macro(ctkMacroBuildQtPlugin)
   # Wrap
   set(MY_QRC_SRCS "")
   if(CTK_QT_VERSION VERSION_GREATER "4")
-    qt5_wrap_cpp(MY_MOC_CPP ${MY_MOC_SRCS} TARGET ${lib_name})
+    qt5_wrap_cpp(MY_MOC_CPP ${MY_MOC_SRCS} TARGET ${lib_name} OPTIONS -DHAVE_QT5)
     if(DEFINED MY_RESOURCES)
       qt5_add_resources(MY_QRC_SRCS ${MY_RESOURCES})
     endif()

+ 5 - 2
CMake/ctkMacroSetupQt.cmake

@@ -35,12 +35,15 @@ macro(ctkMacroSetupQt)
     set(QT5_INSTALL_PREFIX "" CACHE PATH "The install location of Qt5")
     set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT5_INSTALL_PREFIX})
     set(CTK_QT5_COMPONENTS Core Xml XmlPatterns Concurrent Sql Test)
-    if(CTK_LIB_Widgets OR CTK_LIB_CommandLineModules/Frontend/QtGui)
+    if(CTK_LIB_Widgets OR CTK_LIB_CommandLineModules/Frontend/QtGui OR CTK_BUILD_ALL_LIBRARIES)
       list(APPEND CTK_QT5_COMPONENTS Widgets OpenGL UiTools)
     endif()
-    if(CTK_LIB_CommandLineModules/Frontend/QtWebKit)
+    if(CTK_LIB_CommandLineModules/Frontend/QtWebKit OR CTK_BUILD_ALL_LIBRARIES)
       list(APPEND CTK_QT5_COMPONENTS WebKitWidgets)
     endif()
+    if(CTK_LIB_XNAT/Core OR CTK_BUILD_ALL_LIBRARIES)
+      list(APPEND CTK_QT5_COMPONENTS Script)
+    endif()
     find_package(Qt5 COMPONENTS ${CTK_QT5_COMPONENTS} REQUIRED)
   else()
     set(minimum_required_qt_version "4.6")

+ 2 - 1
CMakeExternals/QtSOAP.cmake

@@ -24,7 +24,7 @@ endif()
 
 if(NOT DEFINED QtSOAP_DIR)
 
-  set(revision_tag 3e49f7a4a1a684779eb66215bad46140d9153731)
+  set(revision_tag 914c72959412bfcbaaf0ea9836b0f34258145600)
   if(${proj}_REVISION_TAG)
     set(revision_tag ${${proj}_REVISION_TAG})
   endif()
@@ -51,6 +51,7 @@ if(NOT DEFINED QtSOAP_DIR)
     CMAKE_CACHE_ARGS
       ${ep_common_cache_args}
       -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:STRING=${CTK_CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+      -DQtSOAP_QT_VERSION:STRING=${CTK_QT_VERSION}
       -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
     DEPENDS
       ${${proj}_DEPENDENCIES}

+ 1 - 0
CMakeExternals/qRestAPI.cmake

@@ -50,6 +50,7 @@ if(NOT DEFINED ${proj}_DIR)
     INSTALL_COMMAND ""
     CMAKE_CACHE_ARGS
       ${ep_common_cache_args}
+      -DqRestAPI_QT_VERSION:STRING=${CTK_QT_VERSION}
       -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
     DEPENDS
       ${${proj}_DEPENDENCIES}

+ 20 - 7
CMakeLists.txt

@@ -482,18 +482,23 @@ ctk_lib_option(DICOM/Widgets
 ctk_lib_option(ImageProcessing/ITK/Core
                "Build the ITK Core library" OFF)
 
+if(CTK_QT_VERSION VERSION_LESS "5")
 ctk_lib_option(Scripting/Python/Core
                "Build the Python Core library" OFF
                CTK_ENABLE_Python_Wrapping)
 
 ctk_lib_option(Scripting/Python/Widgets
                "Build the Python Widgets library" OFF)
+endif()
 
+# VTK libraries have not yet been tested with Qt5
+if(CTK_QT_VERSION VERSION_LESS "5")
 ctk_lib_option(Visualization/VTK/Core
                "Build the VTK Core library" OFF)
 
 ctk_lib_option(Visualization/VTK/Widgets
                "Build the VTK Widgets library" OFF)
+endif()
 
 ctk_lib_option(CommandLineModules/Core
                "Build the Command Line Module core library" OFF)
@@ -513,14 +518,11 @@ ctk_lib_option(CommandLineModules/Backend/LocalProcess
 ctk_lib_option(CommandLineModules/Backend/FunctionPointer
                "Build the Command Line Module back-end for function pointers" OFF)
 
-# The qRestAPI build system does not yet support Qt5
-if(CTK_QT_VERSION VERSION_LESS "5")
 ctk_lib_option(XNAT/Core
                "Build the XNAT Core library" OFF)
 
 ctk_lib_option(XNAT/Widgets
                "Build the XNAT Widgets library" OFF)
-endif()
 
 #ctk_lib_option(Visualization/XIP
 #               "Build the XIP library" OFF)
@@ -578,9 +580,11 @@ ctk_app_option(ctkExampleHostedApp
                "Build the DICOM example application" OFF
                CTK_ENABLE_DICOMApplicationHosting AND CTK_BUILD_EXAMPLES)
 
+if(CTK_QT_VERSION VERSION_LESS "5")
 ctk_app_option(ctkEventBusDemo
                "Build the DICOM example application" OFF
                CTK_ENABLE_PluginFramework AND CTK_BUILD_EXAMPLES)
+endif()
 
 ctk_app_option(ctkCommandLineModuleExplorer
                "Build the Command Line Module Explorer" OFF
@@ -613,21 +617,21 @@ ctk_app_option(ctkDICOMObjectViewer
                "Build the DICOM example application" OFF
                CTK_ENABLE_DICOM AND CTK_BUILD_EXAMPLES)
 
+if(CTK_QT_VERSION VERSION_LESS "5")
 ctk_app_option(ctkSimplePythonShell
                "Build the DICOM example application" OFF
                CTK_ENABLE_Python_Wrapping AND CTK_BUILD_EXAMPLES)
+endif()
 
-if(CTK_USE_QTTESTING)
+if(CTK_USE_QTTESTING AND CTK_QT_VERSION VERSION_LESS "5")
   ctk_app_option(ctkQtTesting
                 "Build the ctkQtTesting example application" OFF
                 CTK_BUILD_EXAMPLES)
 endif()
 
-if(CTK_QT_VERSION VERSION_LESS "5")
 ctk_app_option(ctkXnatTreeBrowser
                "Build the XNAT Tree Browser application" OFF
                CTK_BUILD_EXAMPLES)
-endif()
 
 # Save the set of enabled apps in a cache file
 set(_enabled_apps)
@@ -648,10 +652,13 @@ set(plugin_list
   org.commontk.configadmin
   org.commontk.eventadmin
   org.commontk.log
-  org.commontk.log4qt
   org.commontk.metatype
   )
 
+if(CTK_QT_VERSION VERSION_LESS "5")
+  list(APPEND plugin_list org.commontk.log4qt)
+endif()
+
 foreach(_plugin ${plugin_list})
   ctk_plugin_option(${_plugin} "Build the ${_plugin} plugin." OFF)
 endforeach()
@@ -682,9 +689,11 @@ ctk_plugin_option(org.commontk.dah.examplehost
                   CTK_APP_ctkExampleHost)
 
 # Plug-ins related to the EventBus demo application
+if(CTK_QT_VERSION VERSION_LESS "5")
 ctk_plugin_option(org.commontk.eventbus
                   "Build the org.commontk.eventbus plugin." OFF
                   CTK_APP_ctkEventBusDemo)
+endif()
 
 # Add the PluginsContrib repo to the build system
 option(CTK_USE_CONTRIBUTED_PLUGINS OFF "Use CTK plug-ins from the PluginsContrib repository")
@@ -731,6 +740,10 @@ ctk_enable_option(PluginFramework "Enable Plugin Framework" OFF
 ctk_enable_option(Python_Wrapping "Wrap CTK classes using Qt meta-object system into Python language" OFF
                   CTK_LIB_Scripting/Python/Core)
 mark_as_superbuild(CTK_ENABLE_Python_Wrapping)
+if(CTK_QT_VERSION VERSION_GREATER "4" AND CTK_ENABLE_Python_Wrapping)
+  message(WARNING "Disabling CTK_ENABLE_Python_Wrapping because Qt5 support is still missing")
+  set(CTK_ENABLE_Python_Wrapping OFF CACHE BOOL "Wrap CTK classes using Qt meta-object system into Python language" FORCE)
+endif()
 
 # Build examples
 # Create the logical expression containing the minium set of required options

+ 1 - 1
Libs/Core/Testing/Cpp/ctkDummyPlugin.h

@@ -34,7 +34,7 @@ class CTK_DUMMY_EXPORT ctkDummyPlugin: public QObject//, public ctkDummyInterfac
 {
   Q_OBJECT
 //  Q_INTERFACES(ctkDummyInterface)
-#if QT_VERSION >= 0x50000
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org.commontk.DummyPlugin")
 #endif
 public:

+ 1 - 1
Libs/DICOM/Widgets/Plugins/ctkDICOMWidgetsPlugins.h

@@ -36,7 +36,7 @@ class CTK_DICOM_WIDGETS_PLUGINS_EXPORT ctkDICOMWidgetsPlugins
   , public QDesignerCustomWidgetCollectionInterface
 {
   Q_OBJECT
-#if QT_VERSION >= 0x50000
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org.commontk.DICOM")
 #endif
   Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);

+ 1 - 1
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA1_test/ctkTestPluginAActivator_p.h

@@ -32,7 +32,7 @@ class ctkTestPluginAActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "pluginA1_test")
 #endif
 

+ 1 - 1
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA2_test/ctkTestPluginA2Activator_p.h

@@ -33,7 +33,7 @@ class ctkTestPluginA2Activator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "pluginA2_test")
 #endif
 

+ 1 - 1
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA_test/ctkTestPluginAActivator_p.h

@@ -32,7 +32,7 @@ class ctkTestPluginAActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "pluginA_test")
 #endif
 

+ 1 - 1
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL1_test/ctkActivatorSL1_p.h

@@ -36,7 +36,7 @@ class ctkActivatorSL1 :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "pluginSL1_test")
 #endif
   Q_PROPERTY(bool serviceAdded READ serviceAdded)

+ 1 - 1
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL3_test/ctkActivatorSL3_p.h

@@ -37,7 +37,7 @@ class ctkActivatorSL3 :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "pluginSL3_test")
 #endif
   Q_PROPERTY(bool serviceAdded READ serviceAdded)

+ 1 - 1
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL4_test/ctkActivator_p.h

@@ -31,7 +31,7 @@ class ctkActivator :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator ctkFooService)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "pluginSL4_test")
 #endif
 

+ 6 - 0
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginS_test/ctkTestPluginSActivator.cpp

@@ -45,6 +45,12 @@ ctkTestPluginSActivator::~ctkTestPluginSActivator()
 
 }
 
+//----------------------------------------------------------------------------
+ctkTestPluginSActivator::ctkTestPluginSActivator()
+{
+
+}
+
 #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(pluginS_test, ctkTestPluginSActivator)
 #endif

+ 3 - 1
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginS_test/ctkTestPluginSActivator_p.h

@@ -33,12 +33,14 @@ class ctkTestPluginSActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "pluginS_test")
 #endif
 
 public:
 
+  ctkTestPluginSActivator();
+
   void start(ctkPluginContext* context);
   void stop(ctkPluginContext* context);
 

+ 1 - 1
Libs/PluginFramework/Testing/MetaTypeTestPlugins/pluginAttrPwd_test/ctkTestPluginMTAttrPwdActivator_p.h

@@ -30,7 +30,7 @@ class ctkTestPluginMTAttrPwdActivator :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "pluginAttrPwd_test")
 #endif
 

+ 1 - 1
Libs/PluginFramework/Testing/org.commontk.configadmintest/ctkConfigAdminTestActivator_p.h

@@ -31,7 +31,7 @@ class ctkConfigAdminTestActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org_commontk_configadmintest")
 #endif
 

+ 1 - 1
Libs/PluginFramework/Testing/org.commontk.eventadmintest.perf/ctkEventAdminTestPerfActivator_p.h

@@ -31,7 +31,7 @@ class ctkEventAdminTestPerfActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org_commontk_eventadmintest_perf")
 #endif
 

+ 1 - 1
Libs/PluginFramework/Testing/org.commontk.eventadmintest/ctkEventAdminTestActivator_p.h

@@ -31,7 +31,7 @@ class ctkEventAdminTestActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org_commontk_eventadmintest")
 #endif
 

+ 1 - 1
Libs/PluginFramework/Testing/org.commontk.metatypetest/ctkMetaTypeTestActivator_p.h

@@ -31,7 +31,7 @@ class ctkMetaTypeTestActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org_commontk_metatypetest")
 #endif
 

+ 1 - 1
Libs/PluginFramework/Testing/org.commontk.pluginfwtest.perf/ctkPluginFrameworkTestPerfActivator_p.h

@@ -31,7 +31,7 @@ class ctkPluginFrameworkTestPerfActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org_commontk_pluginfwtest_perf")
 #endif
 

+ 1 - 1
Libs/PluginFramework/Testing/org.commontk.pluginfwtest/ctkPluginFrameworkTestActivator_p.h

@@ -31,7 +31,7 @@ class ctkPluginFrameworkTestActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org_commontk_pluginfwtest")
 #endif
 

+ 1 - 1
Libs/Scripting/Python/Widgets/Plugins/ctkScriptingPythonWidgetsPlugins.h

@@ -34,7 +34,7 @@ class CTK_SCRIPTING_PYTHON_WIDGETS_PLUGINS_EXPORT ctkScriptingPythonWidgetsPlugi
   , public QDesignerCustomWidgetCollectionInterface
 {
   Q_OBJECT
-#if QT_VERSION >= 0x50000
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org.commontk.Python")
 #endif
   Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);

+ 1 - 1
Libs/Visualization/VTK/Widgets/Plugins/ctkVTKWidgetsPlugins.h

@@ -48,7 +48,7 @@ class CTK_VISUALIZATION_VTK_WIDGETS_PLUGINS_EXPORT ctkVTKWidgetsPlugins
   , public QDesignerCustomWidgetCollectionInterface
 {
   Q_OBJECT
-#if QT_VERSION >= 0x50000
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org.commontk.VTKWidgets")
 #endif
   Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);

+ 1 - 1
Libs/Widgets/Plugins/ctkWidgetsPlugins.h

@@ -75,7 +75,7 @@ class CTK_WIDGETS_PLUGINS_EXPORT ctkWidgetsPlugins
 {
   Q_OBJECT
   Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
-#if (QT_VERSION >= 0x50000)
+#ifdef HAVE_QT5
   Q_PLUGIN_METADATA(IID "org.commontk.Widgets")
 #endif
 public:

+ 1 - 4
Libs/Widgets/target_libraries.cmake

@@ -1,12 +1,9 @@
 #
 # See CMake/ctkFunctionGetTargetLibraries.cmake
-# 
+#
 # This file should list the libraries required to build the current CTK libraries
 #
 
 set(target_libraries
   CTKCore
   )
-if (CTK_QT_VERSION VERSION_GREATER "4")
-  list(APPEND target_libraries Qt5Xml_LIBRARIES Qt5OpenGL_LIBRARIES)
-endif()

+ 9 - 1
Libs/XNAT/Core/Testing/CMakeLists.txt

@@ -12,9 +12,17 @@ set(KITTests_MOC_SRCS
   ctkXnatSessionTest.h
   )
 
-QT4_WRAP_CPP(KITTests_MOC_CPP ${KITTests_MOC_SRCS})
+if(CTK_QT_VERSION VERSION_LESS "5")
+  QT4_WRAP_CPP(KITTests_MOC_CPP ${KITTests_MOC_SRCS})
+else()
+  qt5_wrap_cpp(KITTests_MOC_CPP ${KITTests_MOC_SRCS})
+endif()
 
 add_executable(${KIT}CppTests ${Tests} ${KITTests_SRCS} ${KITTests_MOC_SRCS} ${KITTests_MOC_CPP})
 target_link_libraries(${KIT}CppTests ${LIBRARY_NAME} ${CTK_BASE_LIBRARIES})
 
+if(CTK_QT_VERSION VERSION_GREATER "4")
+  target_link_libraries(${KIT}CppTests Qt5::Test)
+endif()
+
 SIMPLE_TEST(ctkXnatSessionTest)

+ 9 - 0
Libs/XNAT/Core/ctkXnatAPI.cpp

@@ -25,6 +25,9 @@
 #include <QNetworkReply>
 #include <QRegExp>
 #include <QUrl>
+#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
+#include <QUrlQuery>
+#endif
 
 // --------------------------------------------------------------------------
 // ctkXnatAPI methods
@@ -44,7 +47,13 @@ ctkXnatAPI::~ctkXnatAPI()
 QUuid ctkXnatAPI::get(const QString& resource, const Parameters& parameters, const qRestAPI::RawHeaders& rawHeaders)
 {
   QUrl url = this->createUrl(resource, parameters);
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
   url.addQueryItem("format", "json");
+#else
+  QUrlQuery urlQuery(url);
+  urlQuery.addQueryItem("format", "json");
+  url.setQuery(urlQuery);
+#endif
   QNetworkReply* queryReply = this->sendRequest(QNetworkAccessManager::GetOperation, url, rawHeaders);
   QUuid queryId = queryReply->property("uuid").toString();
   return queryId;

+ 7 - 3
Libs/XNAT/Core/ctkXnatSession.cpp

@@ -153,7 +153,7 @@ void ctkXnatSessionPrivate::setDefaultHttpHeaders()
   */
   if (!sessionId.isEmpty())
   {
-    rawHeaders[HEADER_COOKIE] = QString("JSESSIONID=%1").arg(sessionId).toAscii();
+    rawHeaders[HEADER_COOKIE] = QString("JSESSIONID=%1").arg(sessionId).toLatin1();
   }
   xnat->setDefaultRawHeaders(rawHeaders);
 }
@@ -265,7 +265,11 @@ QList<ctkXnatObject*> ctkXnatSessionPrivate::results(qRestResult* restResult, QS
       continue;
     }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
     ctkXnatObject* object = reinterpret_cast<ctkXnatObject*>(QMetaType::construct(typeId));
+#else
+    ctkXnatObject* object = reinterpret_cast<ctkXnatObject*>(QMetaType(typeId).create());
+#endif
     if (!customSchemaType.isEmpty())
     {
       // We might have created the default ctkXnatObject sub-class, but can still set
@@ -278,7 +282,7 @@ QList<ctkXnatObject*> ctkXnatSessionPrivate::results(qRestResult* restResult, QS
     while (it.hasNext())
     {
       it.next();
-      object->setProperty(it.key().toAscii().data(), it.value());
+      object->setProperty(it.key().toLatin1().data(), it.value());
     }
 
     results.push_back(object);
@@ -327,7 +331,7 @@ void ctkXnatSession::open()
   qRestAPI::RawHeaders headers;
   headers[HEADER_AUTHORIZATION] = "Basic " +
                                   QByteArray(QString("%1:%2").arg(this->userName())
-                                             .arg(this->password()).toAscii()).toBase64();
+                                             .arg(this->password()).toLatin1()).toBase64();
   QUuid uuid = d->xnat->get("/data/JSESSION", qRestAPI::Parameters(), headers);
   QScopedPointer<qRestResult> restResult(d->xnat->takeResult(uuid));
   if (restResult)

+ 4 - 0
Libs/XNAT/Widgets/CMakeLists.txt

@@ -31,6 +31,10 @@ set(KIT_target_libraries)
 
 ctkFunctionGetTargetLibraries(KIT_target_libraries)
 
+if(CTK_QT_VERSION VERSION_GREATER "4")
+  list(APPEND KIT_target_libraries Qt5::Widgets)
+endif()
+
 ctkMacroBuildLib(
   NAME ${PROJECT_NAME}
   EXPORT_DIRECTIVE ${KIT_export_directive}

+ 2 - 0
Plugins/org.commontk.configadmin/ctkConfigurationAdminActivator.cpp

@@ -79,4 +79,6 @@ void ctkConfigurationAdminActivator::stop(ctkPluginContext* context)
   logFileFallback.close();
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_configadmin, ctkConfigurationAdminActivator)
+#endif

+ 3 - 0
Plugins/org.commontk.configadmin/ctkConfigurationAdminActivator_p.h

@@ -41,6 +41,9 @@ class ctkConfigurationAdminActivator :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_configadmin")
+#endif
 
 public:
 

+ 21 - 10
Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppLogic.cpp

@@ -45,12 +45,23 @@
 // DCMTK includes
 #include <dcmimage.h>
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 #include <QDesktopServices>
+#else
+#include <QStandardPaths>
+#endif
+
 //----------------------------------------------------------------------------
-ctkCommandLineModuleAppLogic::ctkCommandLineModuleAppLogic(const QString & modulelocation):
-ctkDicomAbstractApp(ctkCommandLineModuleAppPlugin::getPluginContext()), AppWidget(0),
-ModuleLocation(modulelocation), ModuleManager(ctkCmdLineModuleManager::WEAK_VALIDATION, QDesktopServices::storageLocation(QDesktopServices::CacheLocation)), 
-ModuleFrontend(0)
+ctkCommandLineModuleAppLogic::ctkCommandLineModuleAppLogic(const QString & modulelocation)
+  : ctkDicomAbstractApp(ctkCommandLineModuleAppPlugin::getPluginContext()),
+    AppWidget(0),
+    ModuleLocation(modulelocation),
+    #if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
+    ModuleManager(ctkCmdLineModuleManager::WEAK_VALIDATION, QDesktopServices::storageLocation(QDesktopServices::CacheLocation)),
+    #else
+    ModuleManager(ctkCmdLineModuleManager::WEAK_VALIDATION, QStandardPaths::writableLocation(QStandardPaths::CacheLocation)),
+    #endif
+    ModuleFrontend(0)
 {
   connect(this, SIGNAL(startProgress()), this, SLOT(onStartProgress()), Qt::QueuedConnection);
   connect(this, SIGNAL(resumeProgress()), this, SLOT(onResumeProgress()), Qt::QueuedConnection);
@@ -106,7 +117,7 @@ void ctkCommandLineModuleAppLogic::do_something()
   ui.CLModuleName->setText(ModuleLocation);
 
   ctkCmdLineModuleReference moduleRef = ModuleManager.registerModule(ModuleLocation);
-  
+
   ModuleFrontend = new ctkCmdLineModuleFrontendQtGui(moduleRef);
 
   QObject* guiHandle = ModuleFrontend->guiHandle();
@@ -141,7 +152,7 @@ void ctkCommandLineModuleAppLogic::onStartProgress()
   // we need to create the button before we receive data from
   // the host, which happens immediately after calling
   // getHostInterface()->notifyStateChanged
-  do_something(); 
+  do_something();
 
   getHostInterface()->notifyStateChanged(ctkDicomAppHosting::INPROGRESS);
 }
@@ -244,7 +255,7 @@ void ctkCommandLineModuleAppLogic::onLoadDataClicked()
     return;
   const ctkDicomAppHosting::Patient& firstpatient = *data.patients.begin();
   QList<QUuid> uuidlist = ctkDicomAvailableDataHelper::getAllUuids(firstpatient);
-  
+
   QString transfersyntax("1.2.840.10008.1.2.1");
   QList<QString> transfersyntaxlist;
   transfersyntaxlist.append(transfersyntax);
@@ -297,7 +308,7 @@ void ctkCommandLineModuleAppLogic::onCreateSecondaryCapture()
   if(pixmap!=NULL)
   {
     QString templatefilename = QDir(OutputLocation).absolutePath();
-    if(templatefilename.isEmpty()==false) templatefilename.append('/'); 
+    if(templatefilename.isEmpty()==false) templatefilename.append('/');
     templatefilename.append("ctkdahscXXXXXX.jpg");
     QString inputFileName, outputFileName;
     {
@@ -334,8 +345,8 @@ void ctkCommandLineModuleAppLogic::onCreateSecondaryCapture()
     qDebug() << "Created Uuid: " << getHostInterface()->generateUID();
 
     ctkDicomAppHosting::AvailableData resultData;
-    ctkDicomAvailableDataHelper::addToAvailableData(resultData, 
-      objectLocatorCache(), 
+    ctkDicomAvailableDataHelper::addToAvailableData(resultData,
+      objectLocatorCache(),
       outputFileName);
 
     bool success = publishData(resultData, true);

+ 3 - 3
Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppPlugin.cpp

@@ -60,7 +60,7 @@ void ctkCommandLineModuleAppPlugin::start(ctkPluginContext* context)
 
   QString argsstring("pluginname ");
   argsstring.append(context->getProperty("dah.args").toString());
-  
+
   QStringList argslist = argsstring.split(" ");
 
   bool parseOkay = false;
@@ -93,6 +93,6 @@ ctkPluginContext* ctkCommandLineModuleAppPlugin::getPluginContext()
   return ctkCommandLineModuleAppPlugin::Context;
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_dah_cmdlinemoduleapp, ctkCommandLineModuleAppPlugin)
-
-
+#endif

+ 3 - 0
Plugins/org.commontk.dah.cmdlinemoduleapp/ctkCommandLineModuleAppPlugin_p.h

@@ -32,6 +32,9 @@ class ctkCommandLineModuleAppPlugin :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_dah_cmdlinemoduleapp")
+#endif
 
 public:
 

+ 4 - 0
Plugins/org.commontk.dah.core/CMakeLists.txt

@@ -47,6 +47,10 @@ set(PLUGIN_resources
 #Compute the plugin dependencies
 ctkFunctionGetTargetLibraries(PLUGIN_target_libraries)
 
+if(CTK_QT_VERSION VERSION_GREATER "4")
+  list(APPEND PLUGIN_target_libraries Qt5::Network Qt5::Widgets)
+endif()
+
 ctkMacroBuildPlugin(
   NAME ${PROJECT_NAME}
   EXPORT_DIRECTIVE ${PLUGIN_export_directive}

+ 2 - 2
Plugins/org.commontk.dah.core/Testing/Cpp/ctkDicomObjectLocatorCacheTest1.cpp

@@ -45,7 +45,7 @@ int ctkDicomObjectLocatorCacheTest1(int argc, char* argv[])
     }
 
   //----------------------------------------------------------------------------
-  QString objectUuid = QUuid::createUuid();
+  QString objectUuid = QUuid::createUuid().toString();
   ctkDicomAppHosting::ObjectLocator objectLocator;
   objectLocator.length = 64;
   objectLocator.source = "/path/to/source";
@@ -189,7 +189,7 @@ int ctkDicomObjectLocatorCacheTest1(int argc, char* argv[])
     return EXIT_FAILURE;
     }
 
-  QString objectUuid2 = QUuid::createUuid();
+  QString objectUuid2 = QUuid::createUuid().toString();
   ctkDicomAppHosting::ObjectDescriptor objectDescriptor2;
   objectDescriptor2.descriptorUUID = objectUuid2;
   ctkDicomAppHosting::ObjectLocator objectLocator2;

+ 3 - 1
Plugins/org.commontk.dah.core/ctkDicomAppHostingCorePlugin.cpp

@@ -34,7 +34,7 @@ ctkDicomAppHostingCorePlugin::ctkDicomAppHostingCorePlugin()
 //----------------------------------------------------------------------------
 ctkDicomAppHostingCorePlugin::~ctkDicomAppHostingCorePlugin()
 {
-  
+
 }
 
 //----------------------------------------------------------------------------
@@ -62,4 +62,6 @@ ctkPluginContext* ctkDicomAppHostingCorePlugin::getPluginContext() const
   return context;
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_dah_core, ctkDicomAppHostingCorePlugin)
+#endif

+ 3 - 0
Plugins/org.commontk.dah.core/ctkDicomAppHostingCorePlugin_p.h

@@ -30,6 +30,9 @@ class ctkDicomAppHostingCorePlugin :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_dah_core")
+#endif
 
 public:
 

+ 31 - 31
Plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelper.cpp

@@ -219,7 +219,7 @@ ctkDicomSoapArrayOfStringType::ctkDicomSoapArrayOfStringType(const QString& type
 //  : QtSoapArray(QtSoapQName(name), QtSoapType::String, array.size())
   : QtSoapStruct(QtSoapQName(name))
 {
-	 QtSoapStruct *simpleStruct = new QtSoapStruct(QtSoapQName(typeName));
+   QtSoapStruct *simpleStruct = new QtSoapStruct(QtSoapQName(typeName));
   for (QStringList::ConstIterator it = array.constBegin();
        it < array.constEnd(); it++)
     {
@@ -312,14 +312,14 @@ ctkDicomSoapObjectDescriptor::ctkDicomSoapObjectDescriptor(const QString& name,
                  od.mimeType) );*/
 
   /*QStringList mimeType;
-  mimeType.append(od.mimeType); 
+  mimeType.append(od.mimeType);
   this->insert(new ctkDicomSoapArrayOfStringType("MimeType",
-				"MimeType", 
-				mimeType) );*/
+        "MimeType",
+        mimeType) );*/
 
-	QtSoapStruct *stMimeType = new QtSoapStruct(QtSoapQName("MimeType"));
-	stMimeType->insert(new QtSoapSimpleType(QtSoapQName("Type"),od.mimeType));
-	this->insert(stMimeType);
+  QtSoapStruct *stMimeType = new QtSoapStruct(QtSoapQName("MimeType"));
+  stMimeType->insert(new QtSoapSimpleType(QtSoapQName("Type"),od.mimeType));
+  this->insert(stMimeType);
 
   /*this->insert(new QtSoapSimpleType(
                  QtSoapQName("ClassUID"),
@@ -335,35 +335,35 @@ ctkDicomSoapObjectDescriptor::ctkDicomSoapObjectDescriptor(const QString& name,
   /*this->insert(new QtSoapSimpleType(
                  QtSoapQName("Modality"),
                  od.modality) );*/
-	/*QStringList modality;
-	  modality.append(od.modality); 
-	  this->insert(new ctkDicomSoapArrayOfStringType("Modality",
-					"Modality", 
-					modality) );*/
+  /*QStringList modality;
+    modality.append(od.modality);
+    this->insert(new ctkDicomSoapArrayOfStringType("Modality",
+          "Modality",
+          modality) );*/
 
-	QtSoapStruct *structModality = new QtSoapStruct(QtSoapQName("Modality"));
-	structModality->insert(new QtSoapSimpleType(QtSoapQName("Modality"),od.modality));
-	this->insert(structModality);
+  QtSoapStruct *structModality = new QtSoapStruct(QtSoapQName("Modality"));
+  structModality->insert(new QtSoapSimpleType(QtSoapQName("Modality"),od.modality));
+  this->insert(structModality);
 }
 
 //----------------------------------------------------------------------------
 ctkDicomAppHosting::ObjectDescriptor ctkDicomSoapObjectDescriptor::getObjectDescriptor(const QtSoapType& type)
 {
   ctkDicomAppHosting::ObjectDescriptor od;
-  od.descriptorUUID = ctkDicomSoapUUID::getUuid(type["DescriptorUuid"]);
-  od.mimeType = 
+  od.descriptorUUID = ctkDicomSoapUUID::getUuid(type["DescriptorUuid"]).toString();
+  od.mimeType =
       type["Type"].value().toString();
   //const QStringList mimeType = ctkDicomSoapArrayOfStringType::getArray(type["MimeType"]);
   //od.mimeType = mimeType[0];
 
   /*od.classUID =
       type["ClassUID"].value().toString();*/
-  od.classUID = 
-	  ctkDicomSoapUID::getUID(type["ClassUID"]);
+  od.classUID =
+    ctkDicomSoapUID::getUID(type["ClassUID"]);
   /*od.transferSyntaxUID =
       type["TransferSyntaxUID"].value().toString();*/
-  od.transferSyntaxUID = 
-	  ctkDicomSoapUID::getUID(type["TransferSyntaxUID"]);
+  od.transferSyntaxUID =
+    ctkDicomSoapUID::getUID(type["TransferSyntaxUID"]);
 
   od.modality =
       type["Modality"].value().toString();
@@ -471,7 +471,7 @@ ctkDicomSoapStudy::ctkDicomSoapStudy(const QString& name,
 ctkDicomAppHosting::Study ctkDicomSoapStudy::getStudy(const QtSoapType& type)
 {
   ctkDicomAppHosting::Study s;
- 
+
   //s.studyUID = type["StudyUID"].value().toString();
   s.studyUID = ctkDicomSoapUID::getUID(type["StudyUID"]);
 
@@ -573,7 +573,7 @@ ctkDicomSoapAvailableData::ctkDicomSoapAvailableData(const QString& name,
   for (QList<ctkDicomAppHosting::Patient>::ConstIterator it = ad.patients.constBegin();
        it < ad.patients.constEnd(); it++)
   {
-	     patients->append(new ctkDicomSoapPatient("Patient",*it));
+       patients->append(new ctkDicomSoapPatient("Patient",*it));
   }
   this->insert(patients);
 }
@@ -582,7 +582,7 @@ ctkDicomSoapAvailableData::ctkDicomSoapAvailableData(const QString& name,
 ctkDicomAppHosting::AvailableData ctkDicomSoapAvailableData::getAvailableData (const QtSoapType& type)
 {
   ctkDicomAppHosting::AvailableData ad;
-  
+
   //const QtSoapStruct& avData = static_cast<const QtSoapStruct&> (type);
   //for (int i = 0; i < avData.count() ; i++)
   //  {
@@ -630,7 +630,7 @@ ctkDicomSoapObjectLocator::ctkDicomSoapObjectLocator(const QString& name,
                  ol.offset) );
 
   this->insert(new ctkDicomSoapUID("TransferSyntax", ol.transferSyntax) );
-  
+
   this->insert(new QtSoapSimpleType(
                  QtSoapQName("URI"),
                  ol.URI) );
@@ -649,7 +649,7 @@ ctkDicomSoapObjectLocator::ctkDicomSoapObjectLocator(const QString& name,
                  QtSoapQName("TransferSyntax"),
                  ol.transferSyntax) );*/
 
-  
+
 }
 
 //----------------------------------------------------------------------------
@@ -664,20 +664,20 @@ ctkDicomAppHosting::ObjectLocator ctkDicomSoapObjectLocator::getObjectLocator(co
 
   //ol.transferSyntax =
     //  type["TransferSyntax"].value().toString();
-  ol.transferSyntax = 
-	  ctkDicomSoapUID::getUID(type["TransferSyntax"]);
+  ol.transferSyntax =
+    ctkDicomSoapUID::getUID(type["TransferSyntax"]);
 
   ol.URI =
       type["URI"].value().toString();
 
   //ol.locator = type["Locator"].value().toString();
-  ol.locator = ctkDicomSoapUUID::getUuid(type["Locator"]);
+  ol.locator = ctkDicomSoapUUID::getUuid(type["Locator"]).toString();
 
   //ol.source = type["Source"].value().toString();
-  ol.source = ctkDicomSoapUUID::getUuid(type["Source"]);
+  ol.source = ctkDicomSoapUUID::getUuid(type["Source"]).toString();
   //type["Source"].value().toString();
 
- 
+
 
   return ol;
 }

+ 1 - 1
Plugins/org.commontk.dah.core/ctkDicomExchangeService.h

@@ -29,7 +29,7 @@
 #include <org_commontk_dah_core_Export.h>
 
 class org_commontk_dah_core_EXPORT ctkDicomExchangeService :
-    public ctkSimpleSoapClient, public ctkDicomExchangeInterface
+    public ctkSimpleSoapClient, public virtual ctkDicomExchangeInterface
 {
 
 public:

+ 1 - 1
Plugins/org.commontk.dah.core/ctkDicomObjectLocatorCache.cpp

@@ -215,7 +215,7 @@ QList<ctkDicomAppHosting::ObjectLocator> ctkDicomObjectLocatorCache::getData(con
   foreach(const QUuid& uuid, objectUUIDs)
     {
     ctkDicomAppHosting::ObjectLocator objectLocator;
-    bool found = this->find(uuid, objectLocator);
+    bool found = this->find(uuid.toString(), objectLocator);
     if (!found)
       {
       // Use the empty objectLocator

+ 4 - 0
Plugins/org.commontk.dah.core/ctkSimpleSoapServer.cpp

@@ -32,7 +32,11 @@ ctkSimpleSoapServer::ctkSimpleSoapServer(QObject *parent) :
 }
 
 //----------------------------------------------------------------------------
+#if (QT_VERSION < 0x50000)
 void ctkSimpleSoapServer::incomingConnection(int socketDescriptor)
+#else
+void ctkSimpleSoapServer::incomingConnection(qintptr socketDescriptor)
+#endif
 {
   qDebug() << "New incoming connection";
   ctkSoapConnectionRunnable* runnable = new ctkSoapConnectionRunnable(socketDescriptor);

+ 4 - 0
Plugins/org.commontk.dah.core/ctkSimpleSoapServer.h

@@ -50,7 +50,11 @@ public Q_SLOTS:
 
 protected:
 
+#if (QT_VERSION < 0x50000)
   virtual void incomingConnection(int socketDescriptor);
+#else
+  virtual void incomingConnection(qintptr socketDescriptor);
+#endif
 
 };
 

+ 2 - 2
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppPlugin.cpp

@@ -67,6 +67,6 @@ ctkPluginContext* ctkExampleDicomAppPlugin::getPluginContext()
   return ctkExampleDicomAppPlugin::Context;
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_example_dicomapp, ctkExampleDicomAppPlugin)
-
-
+#endif

+ 3 - 0
Plugins/org.commontk.dah.exampleapp/ctkExampleDicomAppPlugin_p.h

@@ -32,6 +32,9 @@ class ctkExampleDicomAppPlugin :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_example_dicomapp")
+#endif
 
 public:
 

+ 3 - 3
Plugins/org.commontk.dah.examplehost/ctkExampleDicomHostPlugin.cpp

@@ -36,7 +36,7 @@ ctkExampleDicomHostPlugin::ctkExampleDicomHostPlugin()
 //----------------------------------------------------------------------------
 ctkExampleDicomHostPlugin::~ctkExampleDicomHostPlugin()
 {
-  
+
 }
 
 //----------------------------------------------------------------------------
@@ -64,6 +64,6 @@ ctkPluginContext* ctkExampleDicomHostPlugin::getPluginContext() const
   return this->Context;
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_dah_examplehost, ctkExampleDicomHostPlugin)
-
-
+#endif

+ 3 - 0
Plugins/org.commontk.dah.examplehost/ctkExampleDicomHostPlugin_p.h

@@ -30,6 +30,9 @@ class ctkExampleDicomHostPlugin :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_dah_examplehost")
+#endif
 
 public:
 

+ 3 - 3
Plugins/org.commontk.dah.host/ctkDicomHostPlugin.cpp

@@ -36,7 +36,7 @@ ctkDicomHostPlugin::ctkDicomHostPlugin()
 //----------------------------------------------------------------------------
 ctkDicomHostPlugin::~ctkDicomHostPlugin()
 {
-  
+
 }
 
 //----------------------------------------------------------------------------
@@ -64,6 +64,6 @@ ctkPluginContext* ctkDicomHostPlugin::getPluginContext() const
   return this->Context;
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_dah_host, ctkDicomHostPlugin)
-
-
+#endif

+ 3 - 0
Plugins/org.commontk.dah.host/ctkDicomHostPlugin_p.h

@@ -30,6 +30,9 @@ class ctkDicomHostPlugin :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_dah_host")
+#endif
 
 public:
 

+ 2 - 0
Plugins/org.commontk.dah.hostedapp/ctkDicomAppPlugin.cpp

@@ -102,4 +102,6 @@ ctkPluginContext* ctkDicomAppPlugin::getPluginContext()
   return ctkDicomAppPlugin::Context;
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_dah_hostedapp, ctkDicomAppPlugin)
+#endif

+ 3 - 0
Plugins/org.commontk.dah.hostedapp/ctkDicomAppPlugin_p.h

@@ -33,6 +33,9 @@ class ctkDicomAppPlugin :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_dah_hostedapp")
+#endif
 
 public:
 

+ 2 - 0
Plugins/org.commontk.eventadmin/ctkEventAdminActivator.cpp

@@ -72,4 +72,6 @@ ctkLogService* ctkEventAdminActivator::getLogService()
   return logTracker;
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_eventadmin, ctkEventAdminActivator)
+#endif

+ 3 - 0
Plugins/org.commontk.eventadmin/ctkEventAdminActivator_p.h

@@ -35,6 +35,9 @@ class ctkEventAdminActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_eventadmin")
+#endif
 
 public:
 

+ 2 - 2
Plugins/org.commontk.log/ctkLogPlugin.cpp

@@ -49,6 +49,6 @@ void ctkLogPlugin::stop(ctkPluginContext* context)
   }
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_log, ctkLogPlugin)
-
-
+#endif

+ 3 - 0
Plugins/org.commontk.log/ctkLogPlugin_p.h

@@ -32,6 +32,9 @@ class ctkLogPlugin :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_log")
+#endif
 
 public:
 

+ 2 - 2
Plugins/org.commontk.metatype/ctkMetaTypeActivator.cpp

@@ -110,6 +110,6 @@ ctkLogService* ctkMetaTypeActivator::getLogService()
 }
 
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_metatype, ctkMetaTypeActivator)
-
-
+#endif

+ 3 - 0
Plugins/org.commontk.metatype/ctkMetaTypeActivator_p.h

@@ -36,6 +36,9 @@ class ctkMetaTypeActivator :
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_metatype")
+#endif
 
 private:
 

+ 2 - 0
Plugins/org.commontk.plugingenerator.core/ctkPluginGeneratorCorePlugin.cpp

@@ -60,4 +60,6 @@ ctkPluginGeneratorCorePlugin* ctkPluginGeneratorCorePlugin::getInstance()
   return instance;
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_plugingenerator_core, ctkPluginGeneratorCorePlugin)
+#endif

+ 3 - 0
Plugins/org.commontk.plugingenerator.core/ctkPluginGeneratorCorePlugin_p.h

@@ -32,6 +32,9 @@ class ctkPluginGeneratorCorePlugin : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_plugingenerator_core")
+#endif
 
 public:
 

+ 2 - 0
Plugins/org.commontk.plugingenerator.ui/ctkPluginGeneratorUiPlugin.cpp

@@ -48,4 +48,6 @@ void ctkPluginGeneratorUiPlugin::stop(ctkPluginContext* context)
   delete mainExtension;
 }
 
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 Q_EXPORT_PLUGIN2(org_commontk_plugingenerator_ui, ctkPluginGeneratorUiPlugin)
+#endif

+ 3 - 0
Plugins/org.commontk.plugingenerator.ui/ctkPluginGeneratorUiPlugin_p.h

@@ -32,6 +32,9 @@ class ctkPluginGeneratorUiPlugin : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#ifdef HAVE_QT5
+  Q_PLUGIN_METADATA(IID "org_commontk_plugingenerator_ui")
+#endif
 
 public: