Browse Source

Qt5 compatibility for almost all libraries.

Not working yet:

 - XNAT libraries
 - VTK dependent libraries
 - Python Wrapping
Sascha Zelzer 11 years ago
parent
commit
448aaf3c3e
96 changed files with 438 additions and 169 deletions
  1. 1 0
      CMake/CTKConfig.cmake.in
  2. 5 0
      CMake/ctkMacroBuildApp.cmake
  3. 6 3
      CMake/ctkMacroBuildLib.cmake
  4. 20 7
      CMake/ctkMacroBuildPlugin.cmake
  5. 8 0
      CMake/ctkMacroSetupQt.cmake
  6. 5 0
      CMakeLists.txt
  7. 1 1
      Libs/CommandLineModules/Backend/XMLChecker/ctkCmdLineModuleBackendXMLChecker.cpp
  8. 12 18
      Libs/CommandLineModules/Core/CMakeLists.txt
  9. 5 1
      Libs/CommandLineModules/Core/Testing/Cpp/CMakeLists.txt
  10. 2 2
      Libs/CommandLineModules/Core/Testing/Cpp/ctkCmdLineModuleDefaultPathBuilderTest.cpp
  11. 6 6
      Libs/CommandLineModules/Core/Testing/Cpp/ctkCmdLineModuleManagerTest.cpp
  12. 16 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleFutureInterface.cpp
  13. 26 1
      Libs/CommandLineModules/Core/ctkCmdLineModuleFutureInterface.h
  14. 5 0
      Libs/CommandLineModules/Core/ctkCmdLineModuleRunException.h
  15. 8 0
      Libs/CommandLineModules/Documentation/Snippets/ModuleManager/main.cpp
  16. 11 7
      Libs/CommandLineModules/Frontend/QtGui/CMakeLists.txt
  17. 4 0
      Libs/CommandLineModules/Frontend/QtGui/Testing/Cpp/CMakeLists.txt
  18. 43 0
      Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleQtComboBox.cpp
  19. 51 0
      Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleQtComboBox_p.h
  20. 1 40
      Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleQtUiLoader.cpp
  21. 1 1
      Libs/CommandLineModules/Frontend/QtGui/target_libraries.cmake
  22. 7 3
      Libs/CommandLineModules/Frontend/QtWebKit/CMakeLists.txt
  23. 8 2
      Libs/CommandLineModules/Testing/Cpp/CMakeLists.txt
  24. 10 2
      Libs/CommandLineModules/Testing/Modules/CMakeLists.txt
  25. 0 1
      Libs/Core/CMakeLists.txt
  26. 4 0
      Libs/DICOM/Core/CMakeLists.txt
  27. 4 0
      Libs/DICOM/Core/Testing/Cpp/CMakeLists.txt
  28. 2 6
      Libs/DICOM/Core/Testing/Cpp/ctkDICOMIndexerTest1.cpp
  29. 1 1
      Libs/DICOM/Core/ctkDICOMUtil.h
  30. 2 5
      Libs/DICOM/Core/target_libraries.cmake
  31. 1 1
      Libs/DICOM/Widgets/CMakeLists.txt
  32. 9 4
      Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMModelTest2.cpp
  33. 4 0
      Libs/DICOM/Widgets/ctkDICOMTableView.cpp
  34. 6 1
      Libs/ImageProcessing/ITK/Core/Testing/Cpp/CMakeLists.txt
  35. 1 1
      Libs/ImageProcessing/ITK/Core/ctkITKErrorLogMessageHandler.h
  36. 8 4
      Libs/PluginFramework/CMakeLists.txt
  37. 3 0
      Libs/PluginFramework/Testing/Cpp/CMakeLists.txt
  38. 3 1
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA1_test/ctkTestPluginAActivator.cpp
  39. 3 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA1_test/ctkTestPluginAActivator_p.h
  40. 2 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA2_test/ctkTestPluginA2Activator.cpp
  41. 3 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA2_test/ctkTestPluginA2Activator_p.h
  42. 2 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA_test/ctkTestPluginAActivator.cpp
  43. 3 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA_test/ctkTestPluginAActivator_p.h
  44. 9 2
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginD_test/CMakeLists.txt
  45. 3 3
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL1_test/ctkActivatorSL1.cpp
  46. 3 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL1_test/ctkActivatorSL1_p.h
  47. 3 1
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL3_test/ctkActivatorSL3.cpp
  48. 3 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL3_test/ctkActivatorSL3_p.h
  49. 2 3
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL4_test/ctkActivator.cpp
  50. 3 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL4_test/ctkActivator_p.h
  51. 2 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginS_test/ctkTestPluginSActivator.cpp
  52. 3 0
      Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginS_test/ctkTestPluginSActivator_p.h
  53. 2 0
      Libs/PluginFramework/Testing/MetaTypeTestPlugins/pluginAttrPwd_test/ctkTestPluginMTAttrPwdActivator.cpp
  54. 3 0
      Libs/PluginFramework/Testing/MetaTypeTestPlugins/pluginAttrPwd_test/ctkTestPluginMTAttrPwdActivator_p.h
  55. 1 1
      Libs/PluginFramework/Testing/MetaTypeTestPlugins/pluginAttrPwd_test/pluginAttrPwd_test_de.ts
  56. 2 0
      Libs/PluginFramework/Testing/org.commontk.configadmintest/ctkConfigAdminTestActivator.cpp
  57. 3 0
      Libs/PluginFramework/Testing/org.commontk.configadmintest/ctkConfigAdminTestActivator_p.h
  58. 2 0
      Libs/PluginFramework/Testing/org.commontk.eventadmintest.perf/ctkEventAdminTestPerfActivator.cpp
  59. 3 0
      Libs/PluginFramework/Testing/org.commontk.eventadmintest.perf/ctkEventAdminTestPerfActivator_p.h
  60. 2 0
      Libs/PluginFramework/Testing/org.commontk.eventadmintest/ctkEventAdminTestActivator.cpp
  61. 3 0
      Libs/PluginFramework/Testing/org.commontk.eventadmintest/ctkEventAdminTestActivator_p.h
  62. 2 0
      Libs/PluginFramework/Testing/org.commontk.metatypetest/ctkMetaTypeTestActivator.cpp
  63. 3 0
      Libs/PluginFramework/Testing/org.commontk.metatypetest/ctkMetaTypeTestActivator_p.h
  64. 2 0
      Libs/PluginFramework/Testing/org.commontk.pluginfwtest.perf/ctkPluginFrameworkTestPerfActivator.cpp
  65. 3 0
      Libs/PluginFramework/Testing/org.commontk.pluginfwtest.perf/ctkPluginFrameworkTestPerfActivator_p.h
  66. 2 0
      Libs/PluginFramework/Testing/org.commontk.pluginfwtest/ctkPluginFrameworkTestActivator.cpp
  67. 3 0
      Libs/PluginFramework/Testing/org.commontk.pluginfwtest/ctkPluginFrameworkTestActivator_p.h
  68. 4 0
      Libs/PluginFramework/ctkPluginAbstractTracked.tpp
  69. 1 0
      Libs/PluginFramework/ctkPluginManifest_p.h
  70. 0 1
      Libs/PluginFramework/ctkPluginStorageSQL.cpp
  71. 11 3
      Libs/Testing/ctkTest.h
  72. 0 15
      Libs/Visualization/VTK/Core/CMakeLists.txt
  73. 0 16
      Libs/Visualization/VTK/Core/Testing/Cpp/CMakeLists.txt
  74. 1 1
      Libs/Visualization/VTK/Core/ctkVTKErrorLogMessageHandler.h
  75. 15 0
      Libs/Visualization/VTK/Widgets/CMakeLists.txt
  76. 16 0
      Libs/Visualization/VTK/Widgets/Testing/Cpp/CMakeLists.txt
  77. 0 0
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKColorTransferFunctionTest1.cpp
  78. 0 0
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKErrorLogMessageHandlerWithThreadsTest1.cpp
  79. 0 0
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKErrorLogModelTest1.cpp
  80. 0 0
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKHistogramTest1.cpp
  81. 0 0
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKHistogramTest2.cpp
  82. 0 0
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKHistogramTest3.cpp
  83. 0 0
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKHistogramTest4.cpp
  84. 0 0
      Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKTransferFunctionRepresentationTest1.cpp
  85. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKColorTransferFunction.cpp
  86. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKColorTransferFunction.h
  87. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKCompositeFunction.cpp
  88. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKCompositeFunction.h
  89. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKHistogram.cpp
  90. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKHistogram.h
  91. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKLookupTable.cpp
  92. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKLookupTable.h
  93. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKPiecewiseFunction.cpp
  94. 0 0
      Libs/Visualization/VTK/Widgets/ctkVTKPiecewiseFunction.h
  95. 0 3
      Libs/Widgets/CMakeLists.txt
  96. 0 1
      Libs/Widgets/Testing/Cpp/CMakeLists.txt

+ 1 - 0
CMake/CTKConfig.cmake.in

@@ -78,6 +78,7 @@ include(${CTK_PLUGIN_USE_FILE})
 
 # Qt configuration
 set(CTK_QT_VERSION "@CTK_QT_VERSION@")
+set(CTK_QT5_COMPONENTS @CTK_QT5_COMPONENTS@)
 
 # Update CMake module path so that calling "find_package(DCMTK)" works as expected 
 # after calling "find_package(CTK)"

+ 5 - 0
CMake/ctkMacroBuildApp.cmake

@@ -69,6 +69,11 @@ macro(ctkMacroBuildApp)
     ${my_library_dirs}
     )
 
+  if(CTK_QT_VERSION VERSION_LESS "5")
+    # Add Qt include dirs and defines
+    include(${QT_USE_FILE})
+  endif()
+
   # Make sure variable are cleared
   set(MY_UI_CPP)
   set(MY_MOC_CPP)

+ 6 - 3
CMake/ctkMacroBuildLib.cmake

@@ -77,6 +77,11 @@ macro(ctkMacroBuildLib)
   #  message(i:${i})
   #endforeach()
 
+  if(CTK_QT_VERSION VERSION_LESS "5")
+    # Add Qt include dirs and defines
+    include(${QT_USE_FILE})
+  endif()
+
   # Add the library directories from the external project
   ctkFunctionGetLibraryDirs(my_library_dirs ${lib_name})
 
@@ -126,11 +131,9 @@ macro(ctkMacroBuildLib)
     endif()
   else()
     QT4_WRAP_UI(MY_UI_CPP ${MY_UI_FORMS})
-    # Add Qt include dirs and defines
-    include(${QT_USE_FILE})
   endif()
   if(DEFINED MY_RESOURCES)
-    if(Qt5Core_FOUND)
+    if(CTK_QT_VERSION VERSION_GREATER "4")
       qt5_add_resources(MY_QRC_SRCS ${MY_RESOURCES})
     else()
       QT4_ADD_RESOURCES(MY_QRC_SRCS ${MY_RESOURCES})

+ 20 - 7
CMake/ctkMacroBuildPlugin.cmake

@@ -59,7 +59,7 @@ macro(ctkMacroBuildPlugin)
   if(NOT DEFINED MY_EXPORT_DIRECTIVE)
     message(FATAL_ERROR "EXPORT_DIRECTIVE is mandatory")
   endif()
-  
+
   # Print a warning if the project name does not match the directory name
   get_filename_component(_dir_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
   string(REPLACE "." "_" _dir_name_with_ ${_dir_name})
@@ -69,12 +69,12 @@ macro(ctkMacroBuildPlugin)
 
   # Define library name
   set(lib_name ${PROJECT_NAME})
-  
+
   # Plug-in target names must contain at leas one _
   if(NOT lib_name MATCHES _)
     message(FATAL_ERROR "The plug-in project name ${lib_name} must contain at least one '_' character")
   endif()
-  
+
   # Plugin are expected to be shared library
   set(MY_LIBRARY_TYPE "SHARED")
 
@@ -143,8 +143,12 @@ macro(ctkMacroBuildPlugin)
     ${my_includes}
     )
 
-  # Add Qt include dirs and defines
-  include(${QT_USE_FILE})
+  if(CTK_QT_VERSION VERSION_LESS "5")
+    # Add Qt include dirs and defines
+    include(${QT_USE_FILE})
+  else()
+    find_package(Qt5LinguistTools REQUIRED)
+  endif()
 
   # Add the library directories from the external project
   ctkFunctionGetLibraryDirs(my_library_dirs ${lib_name})
@@ -227,7 +231,11 @@ macro(ctkMacroBuildPlugin)
   if(MY_TRANSLATIONS)
     set_source_files_properties(${MY_TRANSLATIONS}
                                 PROPERTIES OUTPUT_LOCATION ${_translations_dir})
-    QT4_CREATE_TRANSLATION(_plugin_qm_files ${MY_SRCS} ${MY_UI_FORMS} ${MY_TRANSLATIONS})
+    if(CTK_QT_VERSION VERSION_GREATER "4")
+      qt5_create_translation(_plugin_qm_files ${MY_SRCS} ${MY_UI_FORMS} ${MY_TRANSLATIONS})
+    else()
+      QT4_CREATE_TRANSLATION(_plugin_qm_files ${MY_SRCS} ${MY_UI_FORMS} ${MY_TRANSLATIONS})
+    endif()
   endif()
 
   if(_plugin_qm_files)
@@ -281,6 +289,11 @@ macro(ctkMacroBuildPlugin)
     ${_plugin_qm_files}
     )
 
+  if(MY_TEST_PLUGIN AND CTK_QT_VERSION VERSION_GREATER "4")
+    find_package(Qt5Test REQUIRED)
+    target_link_libraries(${lib_name} Qt5::Test)
+  endif()
+
   # Set the output directory for the plugin
   if(MY_OUTPUT_DIR)
     set(output_dir_suffix "/${MY_OUTPUT_DIR}")
@@ -293,7 +306,7 @@ macro(ctkMacroBuildPlugin)
       # Put plug-ins by default into a "plugins" subdirectory
       set(CTK_PLUGIN_${type}_OUTPUT_DIRECTORY "${CMAKE_${type}_OUTPUT_DIRECTORY}/plugins")
     endif()
-    
+
     if(IS_ABSOLUTE "${CTK_PLUGIN_${type}_OUTPUT_DIRECTORY}")
       set(plugin_${type}_output_dir "${CTK_PLUGIN_${type}_OUTPUT_DIRECTORY}${output_dir_suffix}")
     elseif(CMAKE_${type}_OUTPUT_DIRECTORY)

+ 8 - 0
CMake/ctkMacroSetupQt.cmake

@@ -37,6 +37,14 @@ macro(ctkMacroSetupQt)
       message(FATAL_ERROR "You must specify the install location of Qt5")
     endif()
     set(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)
+      list(APPEND CTK_QT5_COMPONENTS Widgets OpenGL UiTools)
+    endif()
+    if(CTK_LIB_CommandLineModules/Frontend/QtWebKit)
+      list(APPEND CTK_QT5_COMPONENTS WebKitWidgets)
+    endif()
+    find_package(Qt5 COMPONENTS ${CTK_QT5_COMPONENTS} REQUIRED)
   else()
     set(minimum_required_qt_version "4.6")
 

+ 5 - 0
CMakeLists.txt

@@ -513,11 +513,14 @@ 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)
@@ -620,9 +623,11 @@ if(CTK_USE_QTTESTING)
                 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)

+ 1 - 1
Libs/CommandLineModules/Backend/XMLChecker/ctkCmdLineModuleBackendXMLChecker.cpp

@@ -114,7 +114,7 @@ QByteArray ctkCmdLineModuleBackendXMLChecker::rawXmlDescription(const QUrl& loca
     file.open(QFile::ReadOnly);
     return file.readAll();
   }
-  return d->m_HardCodedXML.toAscii();
+  return d->m_HardCodedXML.toLatin1();
 }
 
 

+ 12 - 18
Libs/CommandLineModules/Core/CMakeLists.txt

@@ -59,21 +59,10 @@ set(KIT_MOC_SRCS
   ctkCmdLineModuleManager.h
 )
 
-if(CTK_QT_VERSION VERSION_GREATER "4")
-  QT5_GENERATE_MOCS(
-    ctkCmdLineModuleFrontend.h
-    ctkCmdLineModuleXmlProgressWatcher.h
-    )
-else()
-  QT4_GENERATE_MOCS(
-    ctkCmdLineModuleFrontend.h
-    ctkCmdLineModuleXmlProgressWatcher.h
-    )
-endif()
-
-#list(APPEND KIT_SRCS
-#  ${CMAKE_CURRENT_BINARY_DIR}/moc_ctkCmdLineModuleXmlProgressWatcher.h
-#)
+set(KIT_GENERATE_MOC_SRCS
+  ctkCmdLineModuleFrontend.h
+  ctkCmdLineModuleXmlProgressWatcher.h
+)
 
 # UI files
 set(KIT_UI_FORMS
@@ -84,19 +73,24 @@ set(KIT_resources
   Resources/ctkCmdLineModules.qrc
 )
 
-set(QT_USE_QTXMLPATTERNS 1)
-include(${QT_USE_FILE})
-
 # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
 # 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::XmlPatterns Qt5::Gui Qt5::Concurrent)
+else()
+  set(QT_USE_QTXMLPATTERNS 1)
+  include(${QT_USE_FILE})
+endif()
+
 ctkMacroBuildLib(
   NAME ${PROJECT_NAME}
   EXPORT_DIRECTIVE ${KIT_export_directive}
   INCLUDE_DIRECTORIES ${KIT_include_directories}
   SRCS ${KIT_SRCS}
   MOC_SRCS ${KIT_MOC_SRCS}
+  GENERATE_MOC_SRCS ${KIT_GENERATE_MOC_SRCS}
   UI_FORMS ${KIT_UI_FORMS}
   TARGET_LIBRARIES ${KIT_target_libraries}
   RESOURCES ${KIT_resources}

+ 5 - 1
Libs/CommandLineModules/Core/Testing/Cpp/CMakeLists.txt

@@ -25,7 +25,7 @@ include_directories(
 set(Tests_MOC_CPP)
 set(Tests_UI_CPP)
 set(Tests_RESOURCES_SRCS)
-if (CTK_QT_VERSION VERSION_GREATER "4")
+if(CTK_QT_VERSION VERSION_GREATER "4")
   QT5_WRAP_CPP(Tests_MOC_CPP ${Tests_MOC_SRCS})
   QT5_GENERATE_MOCS(
     ctkCmdLineModuleManagerTest.cpp
@@ -49,6 +49,10 @@ endif()
 add_executable(${KIT}CppTests ${Tests} ${Tests_SRCS} ${Tests_MOC_CPP} ${Tests_UI_CPP} ${Tests_RESOURCES_SRCS})
 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()
+
 #
 # Add Tests
 #

+ 2 - 2
Libs/CommandLineModules/Core/Testing/Cpp/ctkCmdLineModuleDefaultPathBuilderTest.cpp

@@ -22,7 +22,7 @@
 #include <QList>
 #include <QString>
 #include <QDir>
-#include <QApplication>
+#include <QCoreApplication>
 #include <QProcessEnvironment>
 
 // CTK includes
@@ -37,7 +37,7 @@
  */
 int ctkCmdLineModuleDefaultPathBuilderTest(int argc, char* argv[])
 {
-  QApplication myApp(argc, argv);
+  QCoreApplication myApp(argc, argv);
 
   if (argc != 2)
   {

+ 6 - 6
Libs/CommandLineModules/Core/Testing/Cpp/ctkCmdLineModuleManagerTest.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.
-  
+
 =============================================================================*/
 
 

+ 16 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleFutureInterface.cpp

@@ -90,6 +90,9 @@ QFutureInterface<ctkCmdLineModuleResult>::QFutureInterface(State initialState)
   : QFutureInterfaceBase(initialState)
   , d(new ctkCmdLineModuleFutureInterfacePrivate(this))
 {
+#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
+  refT();
+#endif
 }
 
 //----------------------------------------------------------------------------
@@ -97,14 +100,22 @@ QFutureInterface<ctkCmdLineModuleResult>::QFutureInterface(const QFutureInterfac
   : QFutureInterfaceBase(other)
   , d(other.d)
 {
+#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
+  refT();
+#endif
   d->RefCount.ref();
 }
 
 //----------------------------------------------------------------------------
 QFutureInterface<ctkCmdLineModuleResult>::~QFutureInterface()
 {
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
   if (referenceCountIsOne())
     resultStore().clear();
+#else
+  if (!derefT())
+    resultStore().clear();
+#endif
 
   if (!d->RefCount.deref())
   {
@@ -122,7 +133,12 @@ QFutureInterface<ctkCmdLineModuleResult> QFutureInterface<ctkCmdLineModuleResult
 QFutureInterface<ctkCmdLineModuleResult>&
 QFutureInterface<ctkCmdLineModuleResult>::operator=(const QFutureInterface& other)
 {
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
   if (referenceCountIsOne())
+#else
+  other.refT();
+  if (!derefT())
+#endif
     resultStore().clear();
 
   QFutureInterfaceBase::operator=(other);

+ 26 - 1
Libs/CommandLineModules/Core/ctkCmdLineModuleFutureInterface.h

@@ -27,6 +27,13 @@
 #include "ctkCmdLineModuleResult.h"
 
 #include <QFutureInterface>
+#if (QT_VERSION < 0x50000)
+#include <QtCore>
+#else
+#include <QtConcurrent>
+#include <qresultstore.h>
+#endif
+
 
 class ctkCmdLineModuleFuture;
 class ctkCmdLineModuleFutureInterfacePrivate;
@@ -81,10 +88,17 @@ private:
 
   friend struct ctkCmdLineModuleFutureWatcherPrivate;
 
+#if (QT_VERSION < 0x50000)
   QtConcurrent::ResultStore<ctkCmdLineModuleResult> &resultStore()
   { return static_cast<QtConcurrent::ResultStore<ctkCmdLineModuleResult> &>(resultStoreBase()); }
   const QtConcurrent::ResultStore<ctkCmdLineModuleResult> &resultStore() const
   { return static_cast<const QtConcurrent::ResultStore<ctkCmdLineModuleResult> &>(resultStoreBase()); }
+#else
+  QtPrivate::ResultStore<ctkCmdLineModuleResult> &resultStore()
+  { return static_cast<QtPrivate::ResultStore<ctkCmdLineModuleResult> &>(resultStoreBase()); }
+  const QtPrivate::ResultStore<ctkCmdLineModuleResult> &resultStore() const
+  { return static_cast<const QtPrivate::ResultStore<ctkCmdLineModuleResult> &>(resultStoreBase()); }
+#endif
 
   ctkCmdLineModuleFutureInterfacePrivate* d;
 };
@@ -96,8 +110,11 @@ inline void QFutureInterface<ctkCmdLineModuleResult>::reportResult(const ctkCmdL
         return;
     }
 
+#if (QT_VERSION < 0x50000)
     QtConcurrent::ResultStore<ctkCmdLineModuleResult> &store = resultStore();
-
+#else
+    QtPrivate::ResultStore<ctkCmdLineModuleResult> &store = resultStore();
+#endif
 
     if (store.filterMode()) {
         const int resultCountBefore = store.count();
@@ -121,7 +138,11 @@ inline void QFutureInterface<ctkCmdLineModuleResult>::reportResults(const QVecto
         return;
     }
 
+#if (QT_VERSION < 0x50000)
     QtConcurrent::ResultStore<ctkCmdLineModuleResult> &store = resultStore();
+#else
+    QtPrivate::ResultStore<ctkCmdLineModuleResult> &store = resultStore();
+#endif
 
     if (store.filterMode()) {
         const int resultCountBefore = store.count();
@@ -163,7 +184,11 @@ inline QList<ctkCmdLineModuleResult> QFutureInterface<ctkCmdLineModuleResult>::r
     QList<ctkCmdLineModuleResult> res;
     QMutexLocker lock(mutex());
 
+#if (QT_VERSION <= 0x50000)
     QtConcurrent::ResultIterator<ctkCmdLineModuleResult> it = resultStore().begin();
+#else
+    QtPrivate::ResultIterator<ctkCmdLineModuleResult> it = resultStore().begin();
+#endif
     while (it != resultStore().end()) {
         res.append(it.value());
         ++it;

+ 5 - 0
Libs/CommandLineModules/Core/ctkCmdLineModuleRunException.h

@@ -26,7 +26,12 @@
 
 #include <ctkException.h>
 
+#if (QT_VERSION < 0x50000)
 #include <QtCore>
+#else
+#include <QtConcurrent>
+#endif
+
 
 /**
  * \class ctkCmdLineModuleRunException

+ 8 - 0
Libs/CommandLineModules/Documentation/Snippets/ModuleManager/main.cpp

@@ -28,7 +28,11 @@
 #include "ctkCmdLineModuleRunException.h"
 
 #include <QApplication>
+#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
 #include <QDesktopServices>
+#else
+#include <QStandardPaths>
+#endif
 #include <QWidget>
 #include <QUrl>
 #include <QDebug>
@@ -47,7 +51,11 @@ int main(int argc, char** argv)
         // Use "strict" validation mode, rejecting modules with non-valid XML descriptions.
         ctkCmdLineModuleManager::STRICT_VALIDATION,
         // Use the default cache location for this application
+      #if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
         QDesktopServices::storageLocation(QDesktopServices::CacheLocation)
+      #else
+        QStandardPaths::writableLocation(QStandardPaths::CacheLocation)
+      #endif
         );
   // [instantiate-mm]
 

+ 11 - 7
Libs/CommandLineModules/Frontend/QtGui/CMakeLists.txt

@@ -16,6 +16,8 @@ set(KIT_export_directive "CTK_CMDLINEMODULEQTGUI_EXPORT")
 set(KIT_SRCS
   ctkCmdLineModuleFrontendFactoryQtGui.cpp
   ctkCmdLineModuleFrontendQtGui.cpp
+  ctkCmdLineModuleQtComboBox.cpp
+  ctkCmdLineModuleQtComboBox_p.h
   ctkCmdLineModuleQtUiLoader.cpp
   ctkCmdLineModuleObjectTreeWalker_p.h
   ctkCmdLineModuleObjectTreeWalker.cpp
@@ -23,13 +25,10 @@ set(KIT_SRCS
 
 # Headers that should run through moc
 set(KIT_MOC_SRCS
+  ctkCmdLineModuleQtComboBox_p.h
   ctkCmdLineModuleQtUiLoader.h
 )
 
-qt4_generate_mocs(
-  ctkCmdLineModuleQtUiLoader.cpp
-)
-
 # UI files
 set(KIT_UI_FORMS
 )
@@ -39,19 +38,24 @@ set(KIT_resources
   Resources/ctkCmdLineModulesFrontendQtGui.qrc
 )
 
-set(QT_USE_QTUITOOLS 1)
-include(${QT_USE_FILE})
-
 # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
 # 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::UiTools Qt5::Widgets)
+else()
+  set(QT_USE_QTUITOOLS 1)
+  include(${QT_USE_FILE})
+endif()
+
 ctkMacroBuildLib(
   NAME ${PROJECT_NAME}
   EXPORT_DIRECTIVE ${KIT_export_directive}
   INCLUDE_DIRECTORIES ${KIT_include_directories}
   SRCS ${KIT_SRCS}
   MOC_SRCS ${KIT_MOC_SRCS}
+  GENERATE_MOC_SRCS ${KIT_GENERATE_MOC_SRCS}
   UI_FORMS ${KIT_UI_FORMS}
   TARGET_LIBRARIES ${KIT_target_libraries}
   RESOURCES ${KIT_resources}

+ 4 - 0
Libs/CommandLineModules/Frontend/QtGui/Testing/Cpp/CMakeLists.txt

@@ -52,6 +52,10 @@ endif()
 add_executable(${KIT}CppTests ${Tests} ${Tests_SRCS} ${Tests_MOC_CPP} ${Tests_UI_CPP} ${Tests_RESOURCES_SRCS})
 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()
+
 #
 # Add Tests
 #

+ 43 - 0
Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleQtComboBox.cpp

@@ -0,0 +1,43 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) University College London
+
+  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 "ctkCmdLineModuleQtComboBox_p.h"
+
+//-----------------------------------------------------------------------------
+ctkCmdLineModuleQtComboBox::ctkCmdLineModuleQtComboBox(QWidget* parent)
+  : QComboBox(parent)
+{}
+
+//-----------------------------------------------------------------------------
+void ctkCmdLineModuleQtComboBox::setCurrentEnumeration(const QString& text)
+{
+  int i = findText(text);
+  if (i == -1)
+  {
+    return;
+  }
+  this->setCurrentIndex(i);
+}
+
+//-----------------------------------------------------------------------------
+QString ctkCmdLineModuleQtComboBox::currentEnumeration() const
+{
+  return this->currentText();
+}

+ 51 - 0
Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleQtComboBox_p.h

@@ -0,0 +1,51 @@
+/*=============================================================================
+
+  Library: CTK
+
+  Copyright (c) University College London
+
+  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.
+
+=============================================================================*/
+
+#ifndef CTKCMDLINEMODULEQTCOMBOBOX_P_H
+#define CTKCMDLINEMODULEQTCOMBOBOX_P_H
+
+#include <QComboBox>
+
+
+//-----------------------------------------------------------------------------
+/**
+ * \class ctkCmdLineModuleQtComboBox
+ * \brief Private subclass of QComboBox, providing the currentEnumeration and setCurrentEnumeration methods.
+ * \author m.clarkson@ucl.ac.uk
+ * \ingroup CommandLineModulesFrontendQtGui
+ */
+class ctkCmdLineModuleQtComboBox : public QComboBox
+{
+
+  Q_OBJECT
+  Q_PROPERTY(QString currentEnumeration READ currentEnumeration WRITE setCurrentEnumeration)
+
+public:
+
+  ctkCmdLineModuleQtComboBox(QWidget* parent = 0);
+
+  void setCurrentEnumeration(const QString& text);
+
+  QString currentEnumeration() const;
+
+};
+
+
+#endif // CTKCMDLINEMODULEQTCOMBOBOX_P_H

+ 1 - 40
Libs/CommandLineModules/Frontend/QtGui/ctkCmdLineModuleQtUiLoader.cpp

@@ -20,44 +20,7 @@
 
 #include "ctkCmdLineModuleQtUiLoader.h"
 
-#include <QComboBox>
-
-
-//-----------------------------------------------------------------------------
-/**
- * \class ctkCmdLineModuleQtComboBox
- * \brief Private subclass of QComboBox, providing the currentEnumeration and setCurrentEnumeration methods.
- * \author m.clarkson@ucl.ac.uk
- * \ingroup CommandLineModulesFrontendQtGui
- */
-class ctkCmdLineModuleQtComboBox : public QComboBox
-{
-
-  Q_OBJECT
-  Q_PROPERTY(QString currentEnumeration READ currentEnumeration WRITE setCurrentEnumeration)
-
-public:
-
-  ctkCmdLineModuleQtComboBox(QWidget* parent = 0)
-    : QComboBox(parent)
-  {}
-
-  void setCurrentEnumeration(const QString& text)
-  {
-    int i = findText(text);
-    if (i == -1)
-    {
-      return;
-    }
-    this->setCurrentIndex(i);
-  }
-
-  QString currentEnumeration() const
-  {
-    return this->currentText();
-  }
-
-};
+#include <ctkCmdLineModuleQtComboBox_p.h>
 
 //-----------------------------------------------------------------------------
 ctkCmdLineModuleQtUiLoader::ctkCmdLineModuleQtUiLoader(QObject *parent)
@@ -90,5 +53,3 @@ QWidget* ctkCmdLineModuleQtUiLoader::createWidget(const QString& className, QWid
 
   return widget;
 }
-
-#include "moc_ctkCmdLineModuleQtUiLoader.cpp"

+ 1 - 1
Libs/CommandLineModules/Frontend/QtGui/target_libraries.cmake

@@ -1,6 +1,6 @@
 #
 # See CMake/ctkMacroGetTargetLibraries.cmake
-# 
+#
 # This file should list the libraries required to build the current CTK libraries
 #
 

+ 7 - 3
Libs/CommandLineModules/Frontend/QtWebKit/CMakeLists.txt

@@ -32,13 +32,17 @@ set(KIT_resources
   Resources/ctkCmdLineModulesFrontendQtWebKit.qrc
 )
 
-set(QT_USE_QTWEBKIT 1)
-include(${QT_USE_FILE})
-
 # Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
 # 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::WebKitWidgets)
+else()
+  set(QT_USE_QTWEBKIT 1)
+  include(${QT_USE_FILE})
+endif()
+
 ctkMacroBuildLib(
   NAME ${PROJECT_NAME}
   EXPORT_DIRECTIVE ${KIT_export_directive}

+ 8 - 2
Libs/CommandLineModules/Testing/Cpp/CMakeLists.txt

@@ -5,8 +5,10 @@ set(_test_srcs)
 set(_test_mocs)
 
 if(CTK_LIB_CommandLineModules/Frontend/QtGui)
-  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()
 
   if(CTK_LIB_CommandLineModules/Backend/LocalProcess)
     set(_test_cpp_files
@@ -94,6 +96,10 @@ add_executable(${KIT}CppTests ${Tests} ${Tests_SRCS} ${Tests_MOC_CPP} ${Tests_UI
 target_link_libraries(${KIT}CppTests ${_additional_link_libraries})
 add_dependencies(${KIT}CppTests ctkCmdLineTestModules)
 
+if(CTK_QT_VERSION VERSION_GREATER "4")
+  target_link_libraries(${KIT}CppTests Qt5::Gui Qt5::Test)
+endif()
+
 if(TARGET CTKCommandLineModulesCoreCppTests)
   add_dependencies(${KIT}CppTests CTKCommandLineModulesCoreCppTests)
 endif()

+ 10 - 2
Libs/CommandLineModules/Testing/Modules/CMakeLists.txt

@@ -5,10 +5,18 @@
 function(ctkFunctionCreateCmdLineModule name)
   set(_src_files ${ARGN})
   list(APPEND _src_files ctkCmdLineModule${name}.cpp)
-  qt4_add_resources(_src_files ctkCmdLineModule${name}.qrc)
+  if(CTK_QT_VERSION VERSION_LESS "5")
+    qt4_add_resources(_src_files ctkCmdLineModule${name}.qrc)
+  else()
+    qt5_add_resources(_src_files ctkCmdLineModule${name}.qrc)
+  endif()
 
   add_executable(ctkCmdLineModule${name} ${_src_files})
-  target_link_libraries(ctkCmdLineModule${name} CTKCore ${QT_LIBRARIES})
+  if(CTK_QT_VERSION VERSION_LESS "5")
+    target_link_libraries(ctkCmdLineModule${name} CTKCore ${QT_LIBRARIES})
+  else()
+    target_link_libraries(ctkCmdLineModule${name} CTKCore Qt5::Widgets)
+  endif()
   add_dependencies(ctkCmdLineTestModules ctkCmdLineModule${name})
 endfunction()
 

+ 0 - 1
Libs/Core/CMakeLists.txt

@@ -123,7 +123,6 @@ set(KIT_target_libraries)
 ctkFunctionGetTargetLibraries(KIT_target_libraries)
 
 if(CTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5Core REQUIRED)
   list(APPEND KIT_target_libraries Qt5::Core)
 endif()
 

+ 4 - 0
Libs/DICOM/Core/CMakeLists.txt

@@ -120,6 +120,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::Sql Qt5::Gui)
+endif()
+
 # create a dcm query/retrieve service config file that points to the build dir
 set (DCMQRSCP_STORE_DIR ${CMAKE_CURRENT_BINARY_DIR}/Testing)
 configure_file( Resources/dcmqrscp.cfg.in dcmqrscp.cfg )

+ 4 - 0
Libs/DICOM/Core/Testing/Cpp/CMakeLists.txt

@@ -28,6 +28,10 @@ set(LIBRARY_NAME ${PROJECT_NAME})
 add_executable(${KIT}CppTests ${Tests})
 target_link_libraries(${KIT}CppTests ${LIBRARY_NAME})
 
+if(CTK_QT_VERSION VERSION_GREATER "4")
+  target_link_libraries(${KIT}CppTests Qt5::Widgets)
+endif()
+
 #
 # Add Tests
 #

+ 2 - 6
Libs/DICOM/Core/Testing/Cpp/ctkDICOMIndexerTest1.cpp

@@ -20,11 +20,7 @@
 
 // Qt includes
 #include <QCoreApplication>
-#include <QDebug>
 #include <QDir>
-#include <QFileInfo>
-#include <QTreeView>
-#include <QSqlQuery>
 
 // ctkDICOMCore includes
 #include "ctkDICOMDatabase.h"
@@ -36,7 +32,7 @@
 int ctkDICOMIndexerTest1( int argc, char * argv [] )
 {
   QCoreApplication app(argc, argv);
-  
+
   ctkDICOMDatabase database;
   ctkDICOMIndexer indexer;
 
@@ -50,7 +46,7 @@ int ctkDICOMIndexerTest1( int argc, char * argv [] )
 
   // make sure it doesn't crash
   indexer.refreshDatabase(database, QString());
-  
+
   // make sure it doesn't crash
   indexer.refreshDatabase(database, QDir::tempPath());
 

+ 1 - 1
Libs/DICOM/Core/ctkDICOMUtil.h

@@ -23,7 +23,7 @@
 
 // CTK includes
 #include "ctkDICOMCoreExport.h"
-#include "ctkErrorLogModel.h"
+#include "ctkErrorLogLevel.h"
 
 namespace ctk {
 

+ 2 - 5
Libs/DICOM/Core/target_libraries.cmake

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

+ 1 - 1
Libs/DICOM/Widgets/CMakeLists.txt

@@ -70,7 +70,7 @@ set(KIT_UI_FORMS
   Resources/UI/ctkDICOMListenerWidget.ui
   Resources/UI/ctkDICOMQueryRetrieveWidget.ui
   Resources/UI/ctkDICOMQueryWidget.ui
-  Resources/UI/ctkDICOMObjectListWidget.ui 
+  Resources/UI/ctkDICOMObjectListWidget.ui
   Resources/UI/ctkDICOMServerNodeWidget.ui
   Resources/UI/ctkDICOMTableManager.ui
   Resources/UI/ctkDICOMTableView.ui

+ 9 - 4
Libs/DICOM/Widgets/Testing/Cpp/ctkDICOMModelTest2.cpp

@@ -45,14 +45,14 @@
 int ctkDICOMModelTest2( int argc, char * argv [] )
 {
   QApplication app(argc, argv);
-  
+
   if (argc <= 2)
     {
     std::cerr << "Warning, no sql file given. Test stops" << std::endl;
     std::cerr << "Usage: qctkDICOMModelTest1 <scratch.db> <dumpfile.sql>" << std::endl;
     return EXIT_FAILURE;
     }
-  
+
   try
   {
     ctkDICOMDatabase myCTK( argv[1] );
@@ -62,7 +62,7 @@ int ctkDICOMModelTest2( int argc, char * argv [] )
       std::cerr << "Error when initializing the data base: " << argv[2]
           << " error: " << myCTK.lastError().toStdString();
     }
- 
+
     ctkDICOMModel model;
     model.setDatabase(myCTK.database());
 
@@ -72,12 +72,17 @@ int ctkDICOMModelTest2( int argc, char * argv [] )
     layout->addWidget(&viewer);
     topLevel.setLayout(layout);
     viewer.setModel(&model);
-    
+
     QHeaderView* previousHeaderView = viewer.header();
     qDebug() << "previous: " << previousHeaderView->isHidden();
     ctkCheckableHeaderView* headerView = new ctkCheckableHeaderView(Qt::Horizontal, &viewer);
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
     headerView->setClickable(previousHeaderView->isClickable());
     headerView->setMovable(previousHeaderView->isMovable());
+#else
+    headerView->setSectionsClickable(previousHeaderView->sectionsClickable());
+    headerView->setSectionsMovable(previousHeaderView->sectionsMovable());
+#endif
     headerView->setHighlightSections(previousHeaderView->highlightSections());
     headerView->checkableModelHelper()->setPropagateDepth(-1);
     headerView->checkableModelHelper()->setForceCheckability(true);

+ 4 - 0
Libs/DICOM/Widgets/ctkDICOMTableView.cpp

@@ -108,7 +108,11 @@ void ctkDICOMTableViewPrivate::setUpTableView()
       this->tblDicomDatabaseView->setModel(this->dicomSQLFilterModel);
       this->tblDicomDatabaseView->setColumnHidden(0, true);
       this->tblDicomDatabaseView->setSortingEnabled(true);
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
       this->tblDicomDatabaseView->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
+#else
+      this->tblDicomDatabaseView->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
+#endif
       this->hideUIDColumns();
 
       QObject::connect(this->tblDicomDatabaseView->selectionModel(),

+ 6 - 1
Libs/ImageProcessing/ITK/Core/Testing/Cpp/CMakeLists.txt

@@ -49,8 +49,13 @@ REMOVE (TestsToRun ${KIT}CppTests.cpp)
 
 set(LIBRARY_NAME ${PROJECT_NAME})
 
+# The tests depend on stuff in the CTKWidgets library,
+# so add it manually here
+include_directories(${CMAKE_SOURCE_DIR}/Libs/Widgets)
+include_directories(${CMAKE_BINARY_DIR}/Libs/Widgets)
+
 add_executable(${KIT}CppTests ${Tests} ${KIT_HELPER_SRCS})
-target_link_libraries(${KIT}CppTests ${LIBRARY_NAME} ${CTK_BASE_LIBRARIES})
+target_link_libraries(${KIT}CppTests ${LIBRARY_NAME} ${CTK_BASE_LIBRARIES} CTKWidgets)
 
 #
 # Add Tests

+ 1 - 1
Libs/ImageProcessing/ITK/Core/ctkITKErrorLogMessageHandler.h

@@ -26,7 +26,7 @@
 #include <QScopedPointer>
 
 // CTK includes
-#include <ctkErrorLogModel.h>
+#include <ctkErrorLogAbstractMessageHandler.h>
 #include "ctkImageProcessingITKCoreExport.h"
 
 class ctkITKErrorLogMessageHandlerPrivate;

+ 8 - 4
Libs/PluginFramework/CMakeLists.txt

@@ -129,6 +129,14 @@ set(KIT_UI_FORMS
 set(KIT_resources
 )
 
+# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
+# 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::Sql Qt5::Concurrent)
+endif()
+
 # Create a MANIFEST.MF resource for the PluginFramework library,
 # pretending that is is a plugin (the system plugin)
 ctkFunctionGeneratePluginManifest(KIT_SRCS
@@ -136,10 +144,6 @@ ctkFunctionGeneratePluginManifest(KIT_SRCS
   VERSION "0.9.9"
   )
 
-# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
-# The following macro will read the target libraries from the file 'target_libraries.cmake'
-ctkFunctionGetTargetLibraries(KIT_target_libraries)
-
 ctkMacroBuildLib(
   NAME ${PROJECT_NAME}
   EXPORT_DIRECTIVE ${KIT_export_directive}

+ 3 - 0
Libs/PluginFramework/Testing/Cpp/CMakeLists.txt

@@ -20,3 +20,6 @@ set(lib_name ${fwtestutil_lib})
 add_library(${lib_name} SHARED ${SRCS} ${MY_MOC_CXX})
 target_link_libraries(${lib_name} ${fw_lib})
 
+if(CTK_QT_VERSION VERSION_GREATER "4")
+  target_link_libraries(${lib_name} Qt5::Test)
+endif()

+ 3 - 1
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA1_test/ctkTestPluginAActivator.cpp

@@ -39,4 +39,6 @@ void ctkTestPluginAActivator::stop(ctkPluginContext* context)
   Q_UNUSED(context)
 }
 
-Q_EXPORT_PLUGIN2(pluginA_test, ctkTestPluginAActivator)
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+Q_EXPORT_PLUGIN2(pluginA1_test, ctkTestPluginAActivator)
+#endif

+ 3 - 0
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA1_test/ctkTestPluginAActivator_p.h

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

+ 2 - 0
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA2_test/ctkTestPluginA2Activator.cpp

@@ -39,4 +39,6 @@ void ctkTestPluginA2Activator::stop(ctkPluginContext* context)
   s->unregister();
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(pluginA2_test, ctkTestPluginA2Activator)
+#endif

+ 3 - 0
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA2_test/ctkTestPluginA2Activator_p.h

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

+ 2 - 0
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA_test/ctkTestPluginAActivator.cpp

@@ -39,4 +39,6 @@ void ctkTestPluginAActivator::stop(ctkPluginContext* context)
   Q_UNUSED(context)
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(pluginA_test, ctkTestPluginAActivator)
+#endif

+ 3 - 0
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginA_test/ctkTestPluginAActivator_p.h

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

+ 9 - 2
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginD_test/CMakeLists.txt

@@ -8,10 +8,17 @@ set(PLUGIN_SRCS
 
 set(lib_name ${PROJECT_NAME})
 
-include(${QT_USE_FILE})
+if(CTK_QT_VERSION VERSION_LESS "5")
+  include(${QT_USE_FILE})
+endif()
 
 add_library(${lib_name} SHARED ${PLUGIN_SRCS})
-target_link_libraries(${lib_name} ${QT_LIBRARIES})
+
+if(CTK_QT_VERSION VERSION_LESS "5")
+  target_link_libraries(${lib_name} ${QT_LIBRARIES})
+else()
+  target_link_libraries(${lib_name} Qt5::Core)
+endif()
 
 # Apply properties to the library target.
 set_target_properties(${lib_name} PROPERTIES

+ 3 - 3
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL1_test/ctkActivatorSL1.cpp

@@ -36,7 +36,7 @@ ctkActivatorSL1::ctkActivatorSL1()
 //----------------------------------------------------------------------------
 ctkActivatorSL1::~ctkActivatorSL1()
 {
-  
+
 }
 
 //----------------------------------------------------------------------------
@@ -95,6 +95,6 @@ void ctkActivatorSL1::removedService(const ctkServiceReference& reference, ctkFo
   qDebug() << "Removing reference =" << reference;
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(pluginSL1_test, ctkActivatorSL1)
-
-
+#endif

+ 3 - 0
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL1_test/ctkActivatorSL1_p.h

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

+ 3 - 1
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL3_test/ctkActivatorSL3.cpp

@@ -36,7 +36,7 @@ ctkActivatorSL3::ctkActivatorSL3()
 //----------------------------------------------------------------------------
 ctkActivatorSL3::~ctkActivatorSL3()
 {
-  
+
 }
 
 //----------------------------------------------------------------------------
@@ -94,6 +94,8 @@ void ctkActivatorSL3::removedService(const ctkServiceReference& reference, ctkFo
   qDebug() << "SL3: Removing reference =" << reference;
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(pluginSL3_test, ctkActivatorSL3)
+#endif
 
 

+ 3 - 0
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL3_test/ctkActivatorSL3_p.h

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

+ 2 - 3
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL4_test/ctkActivator.cpp

@@ -47,7 +47,6 @@ void ctkActivator::stop(ctkPluginContext* context)
   //unregister will be done automagically
 }
 
-
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(pluginSL4_test, ctkActivator)
-
-
+#endif

+ 3 - 0
Libs/PluginFramework/Testing/FrameworkTestPlugins/pluginSL4_test/ctkActivator_p.h

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

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

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

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

@@ -33,6 +33,9 @@ class ctkTestPluginSActivator : public QObject,
 {
   Q_OBJECT
   Q_INTERFACES(ctkPluginActivator)
+#if (QT_VERSION >= 0x50000)
+  Q_PLUGIN_METADATA(IID "pluginS_test")
+#endif
 
 public:
 

+ 2 - 0
Libs/PluginFramework/Testing/MetaTypeTestPlugins/pluginAttrPwd_test/ctkTestPluginMTAttrPwdActivator.cpp

@@ -37,6 +37,8 @@ void ctkTestPluginMTAttrPwdActivator::stop(ctkPluginContext* context)
   Q_UNUSED(context)
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(pluginAttrPwd_test, ctkTestPluginMTAttrPwdActivator)
+#endif
 
 

+ 3 - 0
Libs/PluginFramework/Testing/MetaTypeTestPlugins/pluginAttrPwd_test/ctkTestPluginMTAttrPwdActivator_p.h

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

+ 1 - 1
Libs/PluginFramework/Testing/MetaTypeTestPlugins/pluginAttrPwd_test/pluginAttrPwd_test_de.ts

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0" language="de_DE">
+<TS version="2.1" language="de_DE">
 <context>
     <name>ctkTestPluginMTAttrPwdActivator</name>
     <message>

+ 2 - 0
Libs/PluginFramework/Testing/org.commontk.configadmintest/ctkConfigAdminTestActivator.cpp

@@ -106,4 +106,6 @@ void ctkConfigAdminTestActivator::stop(ctkPluginContext* context)
   configListenerTestSuite = 0;
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(org_commontk_configadmintest, ctkConfigAdminTestActivator)
+#endif

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

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

+ 2 - 0
Libs/PluginFramework/Testing/org.commontk.eventadmintest.perf/ctkEventAdminTestPerfActivator.cpp

@@ -79,4 +79,6 @@ void ctkEventAdminTestPerfActivator::stop(ctkPluginContext* context)
   perfTestSuite = 0;
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(org_commontk_eventadmintest_perf, ctkEventAdminTestPerfActivator)
+#endif

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

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

+ 2 - 0
Libs/PluginFramework/Testing/org.commontk.eventadmintest/ctkEventAdminTestActivator.cpp

@@ -129,4 +129,6 @@ void ctkEventAdminTestActivator::stop(ctkPluginContext* context)
   scenario4TestSuite = 0;
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(org_commontk_eventadmintest, ctkEventAdminTestActivator)
+#endif

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

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

+ 2 - 0
Libs/PluginFramework/Testing/org.commontk.metatypetest/ctkMetaTypeTestActivator.cpp

@@ -82,4 +82,6 @@ void ctkMetaTypeTestActivator::stop(ctkPluginContext* context)
   localeTestSuite = 0;
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(org_commontk_metatypetest, ctkMetaTypeTestActivator)
+#endif

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

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

+ 2 - 0
Libs/PluginFramework/Testing/org.commontk.pluginfwtest.perf/ctkPluginFrameworkTestPerfActivator.cpp

@@ -55,4 +55,6 @@ void ctkPluginFrameworkTestPerfActivator::stop(ctkPluginContext* context)
   perfTestSuite = 0;
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(org_commontk_pluginfwtest_perf, ctkPluginFrameworkTestPerfActivator)
+#endif

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

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

+ 2 - 0
Libs/PluginFramework/Testing/org.commontk.pluginfwtest/ctkPluginFrameworkTestActivator.cpp

@@ -62,4 +62,6 @@ void ctkPluginFrameworkTestActivator::stop(ctkPluginContext* context)
   delete serviceTrackerTestSuite;
 }
 
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
 Q_EXPORT_PLUGIN2(org_commontk_pluginfwtest, ctkPluginFrameworkTestActivator)
+#endif

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

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

+ 4 - 0
Libs/PluginFramework/ctkPluginAbstractTracked.tpp

@@ -277,7 +277,11 @@ void ctkPluginAbstractTracked<S,T,R>::modified()
 template<class S, class T, class R>
 int ctkPluginAbstractTracked<S,T,R>::getTrackingCount() const
 {
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
   return trackingCount;
+#else
+  return trackingCount.load();
+#endif
 }
 
 //----------------------------------------------------------------------------

+ 1 - 0
Libs/PluginFramework/ctkPluginManifest_p.h

@@ -23,6 +23,7 @@
 #define CTKPLUGINMANIFEST_P_H
 
 #include <QHash>
+#include <QStringList>
 
 class QIODevice;
 

+ 0 - 1
Libs/PluginFramework/ctkPluginStorageSQL.cpp

@@ -30,7 +30,6 @@
 #include "ctkPluginFrameworkContext_p.h"
 #include "ctkServiceException.h"
 
-#include <QApplication>
 #include <QFileInfo>
 #include <QUrl>
 

+ 11 - 3
Libs/Testing/ctkTest.h

@@ -34,13 +34,14 @@ int TestObject(int argc, char *argv[]) \
     return QTest::qExec(&tc, argc, argv); \
 }
 
-#ifdef QT_GUI_LIB
+#if (QT_VERSION < 0x50000 && QT_GUI_LIB) || (QT_VERSION >= 0x50000 && QT_WIDGETS_LIB)
 
 //-----------------------------------------------------------------------------
 #define CTK_TEST_MAIN(TestObject) \
   int TestObject(int argc, char *argv[]) \
   { \
     QApplication app(argc, argv); \
+    QTEST_DISABLE_KEYPAD_NAVIGATION \
     TestObject##er tc; \
     return QTest::qExec(&tc, argc, argv); \
   }
@@ -52,7 +53,6 @@ int TestObject(int argc, char *argv[]) \
   int TestObject(int argc, char *argv[]) \
   { \
     QCoreApplication app(argc, argv); \
-    QTEST_DISABLE_KEYPAD_NAVIGATION \
     TestObject##er tc; \
     return QTest::qExec(&tc, argc, argv); \
   }
@@ -61,6 +61,9 @@ int TestObject(int argc, char *argv[]) \
 
 namespace ctkTest
 {
+
+#if (QT_VERSION < 0x50000 && QT_GUI_LIB) || (QT_VERSION >= 0x50000 && QT_WIDGETS_LIB)
+
 // ----------------------------------------------------------------------------
 static void mouseEvent(QTest::MouseAction action, QWidget *widget, Qt::MouseButton button,
                        Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
@@ -98,11 +101,16 @@ static void mouseEvent(QTest::MouseAction action, QWidget *widget, Qt::MouseButt
     }
 }
 
+#endif
+
+#if (QT_VERSION < 0x50000 && QT_GUI_LIB) || (QT_VERSION >= 0x50000 && QT_WIDGETS_LIB)
+
 // ----------------------------------------------------------------------------
 inline void mouseMove(QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0,
                       QPoint pos = QPoint(), int delay=-1)
   { ctkTest::mouseEvent(QTest::MouseMove, widget, button, stateKey, pos, delay); }
 
+#endif
 
 // ----------------------------------------------------------------------------
 inline void COMPARE(double v1, double v2)
@@ -129,6 +137,6 @@ inline void COMPARE(double v1, double v2)
     }
 }
 
-}; // end ctkTest namespace
+} // end ctkTest namespace
 
 #endif

+ 0 - 15
Libs/Visualization/VTK/Core/CMakeLists.txt

@@ -18,36 +18,21 @@ set(KIT_export_directive "CTK_VISUALIZATION_VTK_CORE_EXPORT")
 
 # Source files
 set(KIT_SRCS
-  ctkVTKColorTransferFunction.cpp
-  ctkVTKColorTransferFunction.h
-  ctkVTKCompositeFunction.cpp
-  ctkVTKCompositeFunction.h
   ctkVTKConnection.cpp
   ctkVTKConnection.h
   ctkVTKErrorLogMessageHandler.cpp
   ctkVTKErrorLogMessageHandler.h
-  ctkVTKHistogram.cpp
-  ctkVTKHistogram.h
-  ctkVTKLookupTable.cpp
-  ctkVTKLookupTable.h
   ctkVTKObject.h
   ctkVTKObjectEventsObserver.cpp
   ctkVTKObjectEventsObserver.h
-  ctkVTKPiecewiseFunction.cpp
-  ctkVTKPiecewiseFunction.h
   vtkLightBoxRendererManager.cpp
   vtkLightBoxRendererManager.h
   )
 
 # Headers that should run through moc
 set(KIT_MOC_SRCS
-  ctkVTKColorTransferFunction.h
   ctkVTKConnection.h
-  ctkVTKCompositeFunction.h
-  ctkVTKLookupTable.h
-  ctkVTKHistogram.h
   ctkVTKObjectEventsObserver.h
-  ctkVTKPiecewiseFunction.h
   )
 
 # UI files

+ 0 - 16
Libs/Visualization/VTK/Core/Testing/Cpp/CMakeLists.txt

@@ -4,16 +4,8 @@ set(KIT ${PROJECT_NAME})
 # Tests
 #
 set(TEST_SOURCES
-  ctkVTKColorTransferFunctionTest1.cpp
   ctkVTKConnectionTest1.cpp
-  ctkVTKErrorLogMessageHandlerWithThreadsTest1.cpp
-  ctkVTKErrorLogModelTest1.cpp
-  ctkVTKHistogramTest1.cpp
-  ctkVTKHistogramTest2.cpp
-  ctkVTKHistogramTest3.cpp
-  ctkVTKHistogramTest4.cpp
   ctkVTKObjectTest1.cpp
-  ctkVTKTransferFunctionRepresentationTest1.cpp
   )
 
 #
@@ -69,16 +61,8 @@ target_link_libraries(${KIT}CppTests ${LIBRARY_NAME} ${CTK_BASE_LIBRARIES})
 # Add Tests
 #
 
-SIMPLE_TEST( ctkVTKColorTransferFunctionTest1 )
 SIMPLE_TEST( ctkVTKConnectionTest1 )
-SIMPLE_TEST( ctkVTKErrorLogMessageHandlerWithThreadsTest1 )
-SIMPLE_TEST( ctkVTKErrorLogModelTest1 )
-SIMPLE_TEST( ctkVTKHistogramTest1 )
-SIMPLE_TEST( ctkVTKHistogramTest2 )
-SIMPLE_TEST( ctkVTKHistogramTest3 )
-SIMPLE_TEST( ctkVTKHistogramTest4 )
 SIMPLE_TEST( ctkVTKObjectTest1 )
-SIMPLE_TEST( ctkVTKTransferFunctionRepresentationTest1 )
 
 #
 # Add Tests expecting CTKData to be set

+ 1 - 1
Libs/Visualization/VTK/Core/ctkVTKErrorLogMessageHandler.h

@@ -26,7 +26,7 @@
 #include <QScopedPointer>
 
 // CTK includes
-#include <ctkErrorLogModel.h>
+#include <ctkErrorLogAbstractMessageHandler.h>
 #include "ctkVisualizationVTKCoreExport.h"
 
 class ctkVTKErrorLogMessageHandlerPrivate;

+ 15 - 0
Libs/Visualization/VTK/Widgets/CMakeLists.txt

@@ -25,15 +25,25 @@ set(KIT_SRCS
   ctkVTKAbstractView.cpp
   ctkVTKAbstractView.h
   ctkVTKAbstractView_p.h
+  ctkVTKColorTransferFunction.cpp
+  ctkVTKColorTransferFunction.h
+  ctkVTKCompositeFunction.cpp
+  ctkVTKCompositeFunction.h
   ctkVTKDataSetModel.cpp
   ctkVTKDataSetModel.h
   ctkVTKDataSetArrayComboBox.cpp
   ctkVTKDataSetArrayComboBox.h
+  ctkVTKHistogram.cpp
+  ctkVTKHistogram.h
+  ctkVTKLookupTable.cpp
+  ctkVTKLookupTable.h
   ctkVTKMagnifyView.cpp
   ctkVTKMagnifyView.h
   ctkVTKMagnifyView_p.h
   ctkVTKMatrixWidget.cpp
   ctkVTKMatrixWidget.h
+  ctkVTKPiecewiseFunction.cpp
+  ctkVTKPiecewiseFunction.h
   ctkVTKPropertyWidget.cpp
   ctkVTKPropertyWidget.h
   ctkVTKRenderView.cpp
@@ -63,11 +73,16 @@ set(KIT_MOC_SRCS
   ctkVTKAbstractMatrixWidget_p.h
   ctkVTKAbstractView.h
   ctkVTKAbstractView_p.h
+  ctkVTKColorTransferFunction.h
+  ctkVTKCompositeFunction.h
   ctkVTKDataSetArrayComboBox.h
   ctkVTKDataSetModel.h
+  ctkVTKHistogram.h
+  ctkVTKLookupTable.h
   ctkVTKMagnifyView.h
   ctkVTKMagnifyView_p.h
   ctkVTKMatrixWidget.h
+  ctkVTKPiecewiseFunction.h
   ctkVTKPropertyWidget.h
   ctkVTKRenderView.h
   ctkVTKRenderView_p.h

+ 16 - 0
Libs/Visualization/VTK/Widgets/Testing/Cpp/CMakeLists.txt

@@ -4,8 +4,15 @@ set(KIT ${PROJECT_NAME})
 # Tests
 #
 set(TEST_SOURCES
+  ctkVTKColorTransferFunctionTest1.cpp
   ctkVTKDataSetArrayComboBoxTest1.cpp
   ctkVTKDataSetModelTest1.cpp
+  ctkVTKErrorLogMessageHandlerWithThreadsTest1.cpp
+  ctkVTKErrorLogModelTest1.cpp
+  ctkVTKHistogramTest1.cpp
+  ctkVTKHistogramTest2.cpp
+  ctkVTKHistogramTest3.cpp
+  ctkVTKHistogramTest4.cpp
   ctkVTKMatrixWidgetTest1.cpp
   ctkVTKMagnifyViewTest1.cpp
   ctkVTKScalarBarWidgetTest1.cpp
@@ -23,6 +30,7 @@ set(TEST_SOURCES
   ctkVTKSurfaceMaterialPropertyWidgetTest1.cpp
   ctkVTKTextPropertyWidgetTest1.cpp
   ctkVTKThumbnailViewTest1.cpp
+  ctkVTKTransferFunctionRepresentationTest1.cpp
   ctkVTKWidgetsUtilsTestGrabWidget.cpp
   )
 
@@ -133,8 +141,15 @@ target_link_libraries(${KIT}CppTests ${LIBRARY_NAME} ${VTK_CHARTS_LIB} ${CTK_BAS
 # Add Tests
 #
 
+SIMPLE_TEST( ctkVTKColorTransferFunctionTest1 )
 SIMPLE_TEST( ctkVTKDataSetArrayComboBoxTest1 )
 SIMPLE_TEST( ctkVTKDataSetModelTest1 )
+SIMPLE_TEST( ctkVTKErrorLogMessageHandlerWithThreadsTest1 )
+SIMPLE_TEST( ctkVTKErrorLogModelTest1 )
+SIMPLE_TEST( ctkVTKHistogramTest1 )
+SIMPLE_TEST( ctkVTKHistogramTest2 )
+SIMPLE_TEST( ctkVTKHistogramTest3 )
+SIMPLE_TEST( ctkVTKHistogramTest4 )
 SIMPLE_TEST( ctkVTKMagnifyViewTest1 )
 SIMPLE_TEST( ctkVTKMatrixWidgetTest1 )
 SIMPLE_TEST( ctkVTKPropertyWidgetTest )
@@ -163,6 +178,7 @@ SIMPLE_TEST( ctkVTKSliceViewTest1 )
 SIMPLE_TEST( ctkVTKSurfaceMaterialPropertyWidgetTest1 )
 SIMPLE_TEST( ctkVTKTextPropertyWidgetTest1 )
 SIMPLE_TEST( ctkVTKThumbnailViewTest1 )
+SIMPLE_TEST( ctkVTKTransferFunctionRepresentationTest1 )
 SIMPLE_TEST( ctkVTKWidgetsUtilsTestGrabWidget )
 
 #

Libs/Visualization/VTK/Core/Testing/Cpp/ctkVTKColorTransferFunctionTest1.cpp → Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKColorTransferFunctionTest1.cpp


Libs/Visualization/VTK/Core/Testing/Cpp/ctkVTKErrorLogMessageHandlerWithThreadsTest1.cpp → Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKErrorLogMessageHandlerWithThreadsTest1.cpp


Libs/Visualization/VTK/Core/Testing/Cpp/ctkVTKErrorLogModelTest1.cpp → Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKErrorLogModelTest1.cpp


Libs/Visualization/VTK/Core/Testing/Cpp/ctkVTKHistogramTest1.cpp → Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKHistogramTest1.cpp


Libs/Visualization/VTK/Core/Testing/Cpp/ctkVTKHistogramTest2.cpp → Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKHistogramTest2.cpp


Libs/Visualization/VTK/Core/Testing/Cpp/ctkVTKHistogramTest3.cpp → Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKHistogramTest3.cpp


Libs/Visualization/VTK/Core/Testing/Cpp/ctkVTKHistogramTest4.cpp → Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKHistogramTest4.cpp


Libs/Visualization/VTK/Core/Testing/Cpp/ctkVTKTransferFunctionRepresentationTest1.cpp → Libs/Visualization/VTK/Widgets/Testing/Cpp/ctkVTKTransferFunctionRepresentationTest1.cpp


Libs/Visualization/VTK/Core/ctkVTKColorTransferFunction.cpp → Libs/Visualization/VTK/Widgets/ctkVTKColorTransferFunction.cpp


Libs/Visualization/VTK/Core/ctkVTKColorTransferFunction.h → Libs/Visualization/VTK/Widgets/ctkVTKColorTransferFunction.h


Libs/Visualization/VTK/Core/ctkVTKCompositeFunction.cpp → Libs/Visualization/VTK/Widgets/ctkVTKCompositeFunction.cpp


Libs/Visualization/VTK/Core/ctkVTKCompositeFunction.h → Libs/Visualization/VTK/Widgets/ctkVTKCompositeFunction.h


Libs/Visualization/VTK/Core/ctkVTKHistogram.cpp → Libs/Visualization/VTK/Widgets/ctkVTKHistogram.cpp


Libs/Visualization/VTK/Core/ctkVTKHistogram.h → Libs/Visualization/VTK/Widgets/ctkVTKHistogram.h


Libs/Visualization/VTK/Core/ctkVTKLookupTable.cpp → Libs/Visualization/VTK/Widgets/ctkVTKLookupTable.cpp


Libs/Visualization/VTK/Core/ctkVTKLookupTable.h → Libs/Visualization/VTK/Widgets/ctkVTKLookupTable.h


Libs/Visualization/VTK/Core/ctkVTKPiecewiseFunction.cpp → Libs/Visualization/VTK/Widgets/ctkVTKPiecewiseFunction.cpp


Libs/Visualization/VTK/Core/ctkVTKPiecewiseFunction.h → Libs/Visualization/VTK/Widgets/ctkVTKPiecewiseFunction.h


+ 0 - 3
Libs/Widgets/CMakeLists.txt

@@ -335,9 +335,6 @@ set(KIT_resources
 ctkFunctionGetTargetLibraries(KIT_target_libraries)
 
 if(CTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5Widgets REQUIRED)
-  find_package(Qt5Xml REQUIRED)
-  find_package(Qt5OpenGL REQUIRED)
   list(APPEND KIT_target_libraries Qt5::Widgets Qt5::Xml Qt5::OpenGL)
 endif()
 

+ 0 - 1
Libs/Widgets/Testing/Cpp/CMakeLists.txt

@@ -247,7 +247,6 @@ add_executable(${KIT}CppTests ${Tests} ${Tests_SRCS} ${Tests_MOC_CPP} ${Tests_UI
 target_link_libraries(${KIT}CppTests ${LIBRARY_NAME})
 
 if(CTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5Test REQUIRED)
   target_link_libraries(${KIT}CppTests Qt5::Test)
 endif()