Bläddra i källkod

Add unit tests and Qt Designer plugins to CTKDICOM

Julien Finet 13 år sedan
förälder
incheckning
5750a650cd

+ 1 - 1
Applications/ctkDICOM/CMakeLists.txt

@@ -36,5 +36,5 @@ ctkMacroBuildApp(
 
 # Testing
 IF(BUILD_TESTING)
-  #ADD_SUBDIRECTORY(Testing)
+  ADD_SUBDIRECTORY(Testing)
 ENDIF(BUILD_TESTING)

+ 6 - 3
Applications/ctkDICOM/Testing/Cpp/CMakeLists.txt

@@ -1,15 +1,18 @@
 SET(KIT ${PROJECT_NAME})
 
 CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cpp
+  ctkDICOMTest1.cpp
   )
 
 SET (TestsToRun ${Tests})
 REMOVE (TestsToRun ${KIT}CppTests.cpp)
 
-SET(LIBRARY_NAME ${PROJECT_NAME})
+# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
+# The following macro will read the target libraries from the file 'target_libraries.cmake'
+ctkFunctionGetTargetLibraries(KIT_target_libraries)
 
 ADD_EXECUTABLE(${KIT}CppTests ${Tests})
-TARGET_LINK_LIBRARIES(${KIT}CppTests ${LIBRARY_NAME})
+TARGET_LINK_LIBRARIES(${KIT}CppTests ${KIT_target_libraries})
 
 SET( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)
 IF(WIN32)
@@ -24,4 +27,4 @@ ENDMACRO( SIMPLE_TEST  )
 #
 # Add Tests
 #
-
+SIMPLE_TEST(ctkDICOMTest1)

+ 50 - 0
Applications/ctkDICOM/Testing/Cpp/ctkDICOMTest1.cpp

@@ -0,0 +1,50 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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.
+
+=========================================================================*/
+
+// Qt includes
+#include <QCoreApplication>
+#include <QProcess>
+
+// STD includes
+#include <iostream>
+
+int ctkDICOMTest1(int argc, char * argv [])
+{
+  QCoreApplication app(argc, argv);
+  QString command = QString("ctkDICOM");
+  QProcess process;
+  process.start(command);
+  bool res = process.waitForStarted();
+  if (!res)
+    {
+    std::cerr << '\"' << qPrintable(command) << '\"'
+              << " didn't start correctly" << std::endl;
+    return res ? EXIT_SUCCESS : EXIT_FAILURE;
+    }
+  process.kill();
+  res = process.waitForFinished();
+  if (!res)
+    {
+    std::cerr << '\"' << qPrintable(command) << '\"'
+              << " failed to terminate" << std::endl;
+    return res ? EXIT_SUCCESS : EXIT_FAILURE;
+    }
+  return res ? EXIT_SUCCESS : EXIT_FAILURE;
+}

+ 15 - 0
Applications/ctkDICOM/Testing/Cpp/target_libraries.cmake

@@ -0,0 +1,15 @@
+#
+# See CMake/ctkFunctionGetTargetLibraries.cmake
+# 
+# This file should list the libraries required to build the current CTK application.
+# 
+
+SET(target_libraries
+  )
+
+## Query / Retrieve Testing
+if(CTK_APP_ctkDICOMQuery AND CTK_APP_ctkDICOMRetrieve)
+  LIST(APPEND target_libraries 
+    CTKDICOMCore
+    )
+endif()

+ 0 - 1
Applications/ctkDICOM/ctkDICOMMain.cpp

@@ -84,7 +84,6 @@ int main(int argc, char** argv)
 
   DICOMApp.setDatabaseDirectory(databaseDirectory);
   DICOMApp.show();
-  DICOMApp.raise();
 
   return app.exec();
 }

+ 1 - 1
Applications/ctkDICOMDemoSCU/CMakeLists.txt

@@ -40,5 +40,5 @@ ctkMacroBuildApp(
 
 # Testing
 IF(BUILD_TESTING)
-#  ADD_SUBDIRECTORY(Testing)
+  ADD_SUBDIRECTORY(Testing)
 ENDIF(BUILD_TESTING)

+ 1 - 0
Applications/ctkDICOMDemoSCU/Testing/CMakeLists.txt

@@ -0,0 +1 @@
+ADD_SUBDIRECTORY(Cpp)

+ 30 - 0
Applications/ctkDICOMDemoSCU/Testing/Cpp/CMakeLists.txt

@@ -0,0 +1,30 @@
+SET(KIT ${PROJECT_NAME})
+
+CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cpp
+  ctkDICOMDemoSCUTest1.cpp
+  )
+
+SET (TestsToRun ${Tests})
+REMOVE (TestsToRun ${KIT}CppTests.cpp)
+
+# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
+# The following macro will read the target libraries from the file 'target_libraries.cmake'
+ctkFunctionGetTargetLibraries(KIT_target_libraries)
+
+ADD_EXECUTABLE(${KIT}CppTests ${Tests})
+TARGET_LINK_LIBRARIES(${KIT}CppTests ${KIT_target_libraries})
+
+SET( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)
+IF(WIN32)
+  SET(KIT_TESTS ${CPP_TEST_PATH}/${CMAKE_BUILD_TYPE}/${KIT}CppTests)
+ENDIF(WIN32)
+
+MACRO( SIMPLE_TEST  TESTNAME )
+  ADD_TEST( ${TESTNAME} ${KIT_TESTS} ${TESTNAME} )
+  SET_PROPERTY(TEST ${TESTNAME} PROPERTY LABELS ${PROJECT_NAME})
+ENDMACRO( SIMPLE_TEST  )
+
+#
+# Add Tests
+#
+SIMPLE_TEST(ctkDICOMDemoSCUTest1)

+ 45 - 0
Applications/ctkDICOMDemoSCU/Testing/Cpp/ctkDICOMDemoSCUTest1.cpp

@@ -0,0 +1,45 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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.
+
+=========================================================================*/
+
+// Qt includes
+#include <QCoreApplication>
+#include <QProcess>
+
+// STD includes
+#include <iostream>
+
+int ctkDICOMDemoSCUTest1(int argc, char * argv [])
+{
+  QCoreApplication app(argc, argv);
+  QString peer("www.dicomserver.co.uk");
+  QString port("11112");
+  QString aeTitle("MOVESCP");
+  QStringList parameters;
+  parameters << peer << port << aeTitle;
+  QString command = QString("ctkDICOMDemoSCU");
+  int res = QProcess::execute(command, parameters);
+  if (res != EXIT_SUCCESS)
+    {
+    std::cerr << '\"' << qPrintable(command) << '\"'
+              << " returned " << res << std::endl;
+    return res;
+    }
+  return res;
+}

+ 15 - 0
Applications/ctkDICOMDemoSCU/Testing/Cpp/target_libraries.cmake

@@ -0,0 +1,15 @@
+#
+# See CMake/ctkFunctionGetTargetLibraries.cmake
+# 
+# This file should list the libraries required to build the current CTK application.
+# 
+
+SET(target_libraries
+  )
+
+## Query / Retrieve Testing
+if(CTK_APP_ctkDICOMQuery AND CTK_APP_ctkDICOMRetrieve)
+  LIST(APPEND target_libraries 
+    CTKDICOMCore
+    )
+endif()

+ 1 - 1
Applications/ctkDICOMIndexer/CMakeLists.txt

@@ -36,5 +36,5 @@ ctkMacroBuildApp(
 
 # Testing
 IF(BUILD_TESTING)
-  #ADD_SUBDIRECTORY(Testing)
+  ADD_SUBDIRECTORY(Testing)
 ENDIF(BUILD_TESTING)

+ 6 - 3
Applications/ctkDICOMIndexer/Testing/Cpp/CMakeLists.txt

@@ -1,15 +1,18 @@
 SET(KIT ${PROJECT_NAME})
 
 CREATE_TEST_SOURCELIST(Tests ${KIT}CppTests.cpp
+  ctkDICOMIndexerTest1.cpp
   )
 
 SET (TestsToRun ${Tests})
 REMOVE (TestsToRun ${KIT}CppTests.cpp)
 
-SET(LIBRARY_NAME ${PROJECT_NAME})
+# Target libraries - See CMake/ctkFunctionGetTargetLibraries.cmake
+# The following macro will read the target libraries from the file 'target_libraries.cmake'
+ctkFunctionGetTargetLibraries(KIT_target_libraries)
 
 ADD_EXECUTABLE(${KIT}CppTests ${Tests})
-TARGET_LINK_LIBRARIES(${KIT}CppTests ${LIBRARY_NAME})
+TARGET_LINK_LIBRARIES(${KIT}CppTests ${KIT_target_libraries})
 
 SET( KIT_TESTS ${CPP_TEST_PATH}/${KIT}CppTests)
 IF(WIN32)
@@ -24,4 +27,4 @@ ENDMACRO( SIMPLE_TEST  )
 #
 # Add Tests
 #
-
+SIMPLE_TEST(ctkDICOMIndexerTest1)

+ 62 - 0
Applications/ctkDICOMIndexer/Testing/Cpp/ctkDICOMIndexerTest1.cpp

@@ -0,0 +1,62 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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.
+
+=========================================================================*/
+
+// Qt includes
+#include <QCoreApplication>
+#include <QProcess>
+
+// STD includes
+#include <iostream>
+
+int ctkDICOMIndexerTest1(int argc, char * argv [])
+{
+  QCoreApplication app(argc, argv);
+  QString database("test.db");
+
+  QStringList parameters;
+  parameters << "--init" << database;
+  QString command = QString("ctkDICOMIndexer");
+  int res = QProcess::execute(command, parameters);
+  if (res != EXIT_SUCCESS)
+    {
+    std::cerr << '\"' << qPrintable(command + parameters.join(" ")) << '\"'
+              << " returned " << res << std::endl;
+    return res;
+    }
+  parameters.clear();
+  parameters << "--add" << database << ".";
+  res = QProcess::execute(command, parameters);
+  if (res != EXIT_SUCCESS)
+    {
+    std::cerr << '\"' << qPrintable(command + parameters.join(" ")) << '\"'
+              << " returned " << res << std::endl;
+    return res;
+    }
+  parameters.clear();
+  parameters << "--cleanup" << database;
+  res = QProcess::execute(command, parameters);
+  if (res != EXIT_SUCCESS)
+    {
+    std::cerr << '\"' << qPrintable(command + parameters.join(" ")) << '\"'
+              << " returned " << res << std::endl;
+    return res;
+    }
+  return res;
+}

+ 15 - 0
Applications/ctkDICOMIndexer/Testing/Cpp/target_libraries.cmake

@@ -0,0 +1,15 @@
+#
+# See CMake/ctkFunctionGetTargetLibraries.cmake
+# 
+# This file should list the libraries required to build the current CTK application.
+# 
+
+SET(target_libraries
+  )
+
+## Query / Retrieve Testing
+if(CTK_APP_ctkDICOMQuery AND CTK_APP_ctkDICOMRetrieve)
+  LIST(APPEND target_libraries 
+    CTKDICOMCore
+    )
+endif()

+ 42 - 0
Libs/DICOM/Widgets/Plugins/CMakeLists.txt

@@ -0,0 +1,42 @@
+PROJECT(${PROJECT_NAME}Plugins)
+
+#
+# See CTK/CMake/ctkMacroBuildQtDesignerPlugin.cmake for details
+#
+
+SET(PLUGIN_export_directive "CTK_DICOM_WIDGETS_PLUGINS_EXPORT")
+
+# Source files
+SET(PLUGIN_SRCS
+  ctkDICOMWidgetsPlugins.cpp
+  ctkDICOMWidgetsPlugins.h
+  ctkDICOMWidgetsAbstractPlugin.cpp
+  ctkDICOMWidgetsAbstractPlugin.h
+  ctkQueryRetrieveWidgetPlugin.cpp
+  ctkQueryRetrieveWidgetPlugin.h
+  )
+
+# Headers that should run through moc
+SET(PLUGIN_MOC_SRCS
+  ctkDICOMWidgetsPlugins.h
+
+  ctkQueryRetrieveWidgetPlugin.h
+  )
+
+# Resources
+SET(PLUGIN_resources
+)
+
+# Target libraries
+SET(PLUGIN_target_libraries
+  CTKDICOMWidgets
+  )
+
+ctkMacroBuildQtDesignerPlugin(
+  NAME ${PROJECT_NAME}
+  EXPORT_DIRECTIVE ${PLUGIN_export_directive}
+  SRCS ${PLUGIN_SRCS}
+  MOC_SRCS ${PLUGIN_MOC_SRCS}
+  RESOURCES ${PLUGIN_resources}
+  TARGET_LIBRARIES ${PLUGIN_target_libraries}
+)

+ 68 - 0
Libs/DICOM/Widgets/Plugins/ctkDICOMQueryRetrieveWidget.cpp

@@ -0,0 +1,68 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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.
+
+=========================================================================*/
+
+// CTK includes
+#include "ctkDICOMQueryRetrievePlugin.h"
+#include "ctkDICOMQueryRetrieve.h"
+
+//-----------------------------------------------------------------------------
+ctkDICOMQueryRetrievePlugin::ctkDICOMQueryRetrievePlugin(QObject* pluginParent)
+  : QObject(pluginParent)
+{
+}
+
+//-----------------------------------------------------------------------------
+QWidget *ctkDICOMQueryRetrievePlugin::createWidget(QWidget *parentForWidget)
+{
+  ctkDICOMQueryRetrieve* newWidget = new ctkDICOMQueryRetrieve(parentForWidget);
+  return newWidget;
+}
+
+//-----------------------------------------------------------------------------
+QString ctkDICOMQueryRetrievePlugin::domXml() const
+{
+  return "<widget class=\"ctkDICOMQueryRetrieve\" \
+          name=\"QueryRetrieve\">\n"
+          "</widget>\n";
+}
+
+// --------------------------------------------------------------------------
+QIcon ctkDICOMQueryRetrievePlugin::icon() const
+{
+  return QIcon(":/Icons/listview.png");
+}
+
+//-----------------------------------------------------------------------------
+QString ctkDICOMQueryRetrievePlugin::includeFile() const
+{
+  return "ctkDICOMQueryRetrieve.h";
+}
+
+//-----------------------------------------------------------------------------
+bool ctkDICOMQueryRetrievePlugin::isContainer() const
+{
+  return false;
+}
+
+//-----------------------------------------------------------------------------
+QString ctkDICOMQueryRetrievePlugin::name() const
+{
+  return "ctkDICOMQueryRetrieve";
+}

+ 45 - 0
Libs/DICOM/Widgets/Plugins/ctkDICOMQueryRetrieveWidget.h

@@ -0,0 +1,45 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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 __ctkDICOMQueryRetrievePlugin_h
+#define __ctkDICOMQueryRetrievePlugin_h
+
+// CTK includes
+#include "ctkWidgetsAbstractPlugin.h"
+
+class CTK_DICOM_WIDGETS_PLUGINS_EXPORT ctkDICOMQueryRetrievePlugin
+  : public QObject
+  , public ctkWidgetsAbstractPlugin
+{
+  Q_OBJECT
+
+public:
+  ctkDICOMQueryRetrievePlugin(QObject *_parent = 0);
+  
+  QWidget *createWidget(QWidget *_parent);
+  QString  domXml() const; 
+  QIcon    icon() const;
+  QString  includeFile() const;
+  bool     isContainer() const;
+  QString  name() const;
+  
+};
+
+#endif

+ 63 - 0
Libs/DICOM/Widgets/Plugins/ctkDICOMWidgetsAbstractPlugin.cpp

@@ -0,0 +1,63 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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.
+
+=========================================================================*/
+
+// CTK includes
+#include "ctkDICOMWidgetsAbstractPlugin.h"
+
+//-----------------------------------------------------------------------------
+ctkDICOMWidgetsAbstractPlugin::ctkDICOMWidgetsAbstractPlugin()
+{
+  this->Initialized = false;
+}
+
+//-----------------------------------------------------------------------------
+QString ctkDICOMWidgetsAbstractPlugin::group() const
+{ 
+  return "CTK [DICOM Widgets]";
+}
+
+//-----------------------------------------------------------------------------
+QIcon ctkDICOMWidgetsAbstractPlugin::icon() const
+{
+  return QIcon(); 
+}
+
+//-----------------------------------------------------------------------------
+QString ctkDICOMWidgetsAbstractPlugin::toolTip() const
+{ 
+  return QString(); 
+}
+
+//-----------------------------------------------------------------------------
+QString ctkDICOMWidgetsAbstractPlugin::whatsThis() const
+{
+  return QString(); 
+}
+
+//-----------------------------------------------------------------------------
+void ctkDICOMWidgetsAbstractPlugin::initialize(QDesignerFormEditorInterface *formEditor)
+{
+  Q_UNUSED(formEditor);
+  if (this->Initialized)
+    {
+    return;
+    }
+  this->Initialized = true;
+}

+ 51 - 0
Libs/DICOM/Widgets/Plugins/ctkDICOMWidgetsAbstractPlugin.h

@@ -0,0 +1,51 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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 __ctkDICOMWidgetsAbstractPlugin_h
+#define __ctkDICOMWidgetsAbstractPlugin_h
+
+// Qt includes
+#include <QDesignerCustomWidgetInterface>
+
+// CTK includes
+#include "ctkDICOMWidgetsPluginsExport.h"
+
+class CTK_DICOM_WIDGETS_PLUGINS_EXPORT ctkDICOMWidgetsAbstractPlugin :
+  public QDesignerCustomWidgetInterface
+{
+  Q_INTERFACES(QDesignerCustomWidgetInterface);
+public:
+
+  ctkDICOMWidgetsAbstractPlugin();
+  
+  // Do *NOT* reimplement this method.
+  QString group() const;
+  
+  // You can reimplement these methods
+  virtual QIcon icon() const;
+  virtual QString toolTip() const;
+  virtual QString whatsThis() const;
+  virtual void initialize(QDesignerFormEditorInterface *formEditor);
+  
+protected:
+  bool Initialized;
+};
+
+#endif

+ 27 - 0
Libs/DICOM/Widgets/Plugins/ctkDICOMWidgetsPlugins.cpp

@@ -0,0 +1,27 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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.
+
+=========================================================================*/
+
+// Qt includes
+#include <QtPlugin>
+
+// CTK includes
+#include "ctkDICOMWidgetsPlugins.h"
+
+Q_EXPORT_PLUGIN2(customwidgetplugin, ctkDICOMWidgetsPlugins);

+ 48 - 0
Libs/DICOM/Widgets/Plugins/ctkDICOMWidgetsPlugins.h

@@ -0,0 +1,48 @@
+/*=========================================================================
+
+  Library:   CTK
+
+  Copyright (c) Kitware Inc.
+
+  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.txt
+
+  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 __ctkDICOMWidgetsPlugins_h
+#define __ctkDICOMWidgetsPlugins_h
+
+// Qt includes
+#include <QDesignerCustomWidgetCollectionInterface>
+
+// CTK includes
+#include "ctkDICOMWidgetsPluginsExport.h"
+#include "ctkQueryRetrieveWidgetPlugin.h"
+
+/// \class Group the plugins in one library
+class CTK_DICOM_WIDGETS_PLUGINS_EXPORT ctkDICOMWidgetsPlugins
+  : public QObject
+  , public QDesignerCustomWidgetCollectionInterface
+{
+  Q_OBJECT
+  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);
+
+public:
+  QList<QDesignerCustomWidgetInterface*> customWidgets() const
+    {
+    QList<QDesignerCustomWidgetInterface *> plugins;
+    plugins << new ctkQueryRetrieveWidgetPlugin
+    return plugins;
+    }
+};
+
+#endif