소스 검색

Add Qt5 support to QtTesting module

Julien Finet 10 년 전
부모
커밋
e7e8e3961e
37개의 변경된 파일67개의 추가작업 그리고 40개의 파일을 삭제
  1. 13 2
      CMakeExternals/QtTesting.cmake
  2. 4 0
      Libs/QtTesting/CMakeLists.txt
  3. 5 1
      Libs/Widgets/Testing/Cpp/CMakeLists.txt
  4. 1 1
      Libs/Widgets/Testing/Cpp/ctkActionsWidgetEventTranslatorPlayerTest1.cpp
  5. 1 1
      Libs/Widgets/Testing/Cpp/ctkAddRemoveComboBoxEventTranslatorPlayerTest1.cpp
  6. 1 1
      Libs/Widgets/Testing/Cpp/ctkAxesWidgetEventTranslatorPlayerTest1.cpp
  7. 1 1
      Libs/Widgets/Testing/Cpp/ctkButtonGroupEventTranslatorPlayerTest1.cpp
  8. 1 1
      Libs/Widgets/Testing/Cpp/ctkCheckableComboBoxEventTranslatorPlayerTest1.cpp
  9. 10 2
      Libs/Widgets/Testing/Cpp/ctkCheckableHeaderViewEventTranslatorPlayerTest1.cpp
  10. 1 1
      Libs/Widgets/Testing/Cpp/ctkCheckablePushButtonEventTranslatorPlayerTest1.cpp
  11. 1 1
      Libs/Widgets/Testing/Cpp/ctkCollapsibleButtonEventTranslatorPlayerTest1.cpp
  12. 1 1
      Libs/Widgets/Testing/Cpp/ctkCollapsibleGroupBoxEventTranslatorPlayerTest1.cpp
  13. 3 3
      Libs/Widgets/Testing/Cpp/ctkColorDialogEventTranslatorPlayerTest1.cpp
  14. 1 1
      Libs/Widgets/Testing/Cpp/ctkColorPickerButtonEventTranslatorPlayerTest1.cpp
  15. 1 1
      Libs/Widgets/Testing/Cpp/ctkComboBoxEventTranslatorPlayerTest1.cpp
  16. 1 1
      Libs/Widgets/Testing/Cpp/ctkConsoleEventTranslatorPlayerTest1.cpp
  17. 1 1
      Libs/Widgets/Testing/Cpp/ctkCoordinatesWidgetEventTranslatorPlayerTest1.cpp
  18. 1 1
      Libs/Widgets/Testing/Cpp/ctkDirectoryButtonEventTranslatorPlayerTest1.cpp
  19. 1 1
      Libs/Widgets/Testing/Cpp/ctkDoubleRangeSliderEventTranslatorPlayerTest1.cpp
  20. 1 1
      Libs/Widgets/Testing/Cpp/ctkDoubleSliderEventTranslatorPlayerTest1.cpp
  21. 1 1
      Libs/Widgets/Testing/Cpp/ctkExpandButtonEventTranslatorPlayerTest1.cpp
  22. 1 1
      Libs/Widgets/Testing/Cpp/ctkFileDialogEventTranslatorPlayerTest1.cpp
  23. 1 1
      Libs/Widgets/Testing/Cpp/ctkFontButtonEventTranslatorPlayerTest1.cpp
  24. 1 1
      Libs/Widgets/Testing/Cpp/ctkMaterialPropertyWidgetEventTranslatorPlayerTest1.cpp
  25. 1 1
      Libs/Widgets/Testing/Cpp/ctkMatrixWidgetEventTranslatorPlayerTest1.cpp
  26. 1 1
      Libs/Widgets/Testing/Cpp/ctkMenuButtonEventTranslatorPlayerTest1.cpp
  27. 1 1
      Libs/Widgets/Testing/Cpp/ctkMenuComboBoxEventTranslatorPlayerTest1.cpp
  28. 1 1
      Libs/Widgets/Testing/Cpp/ctkMenuEventTranslatorPlayerTest1.cpp
  29. 1 1
      Libs/Widgets/Testing/Cpp/ctkModalityWidgetEventTranslatorPlayerTest1.cpp
  30. 1 1
      Libs/Widgets/Testing/Cpp/ctkPathLineEditEventTranslatorPlayerTest1.cpp
  31. 1 1
      Libs/Widgets/Testing/Cpp/ctkPopupWidgetEventTranslatorPlayerTest1.cpp
  32. 1 1
      Libs/Widgets/Testing/Cpp/ctkRangeSliderEventTranslatorPlayerTest1.cpp
  33. 1 1
      Libs/Widgets/Testing/Cpp/ctkRangeWidgetEventTranslatorPlayerTest1.cpp
  34. 1 1
      Libs/Widgets/Testing/Cpp/ctkSearchBoxEventTranslatorPlayerTest1.cpp
  35. 1 1
      Libs/Widgets/Testing/Cpp/ctkSettingsDialogEventTranslatorPlayerTest1.cpp
  36. 1 1
      Libs/Widgets/Testing/Cpp/ctkSliderWidgetEventTranslatorPlayerTest1.cpp
  37. 1 1
      Libs/Widgets/Testing/Cpp/ctkTreeComboBoxEventTranslatorPlayerTest1.cpp

+ 13 - 2
CMakeExternals/QtTesting.cmake

@@ -24,7 +24,7 @@ endif()
 
 
 if(NOT DEFINED QtTesting_DIR)
 if(NOT DEFINED QtTesting_DIR)
 
 
-  set(revision_tag 7dbef1003157941e7315220f53cf4e17d78b5e28)
+  set(revision_tag a5c52c52516d419802ee1e4b1800ee3aabc5cdd2)
   if(${proj}_REVISION_TAG)
   if(${proj}_REVISION_TAG)
     set(revision_tag ${${proj}_REVISION_TAG})
     set(revision_tag ${${proj}_REVISION_TAG})
   endif()
   endif()
@@ -49,6 +49,17 @@ if(NOT DEFINED QtTesting_DIR)
       -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET})
       -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET})
   endif()
   endif()
 
 
+  set(proj_qt_args
+	  -DQtTesting_QT_VERSION:STRING=${CTK_QT_VERSION})
+  if(CTK_QT_VERSION VERSION_LESS "5")
+    list(APPEND proj_qt_args
+      -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+    )
+  else()
+    list(APPEND proj_qt_args
+      -DCMAKE_PREFIX_PATH:FILEPATH=${CMAKE_PREFIX_PATH}
+    )
+  endif()
   message(STATUS "Adding project:${proj}")
   message(STATUS "Adding project:${proj}")
   ExternalProject_Add(${proj}
   ExternalProject_Add(${proj}
     ${${proj}_EXTERNAL_PROJECT_ARGS}
     ${${proj}_EXTERNAL_PROJECT_ARGS}
@@ -58,8 +69,8 @@ if(NOT DEFINED QtTesting_DIR)
     ${location_args}
     ${location_args}
     CMAKE_CACHE_ARGS
     CMAKE_CACHE_ARGS
       ${ep_common_cache_args}
       ${ep_common_cache_args}
+	  ${proj_qt_args}
       -DBUILD_SHARED_LIBS:BOOL=ON
       -DBUILD_SHARED_LIBS:BOOL=ON
-      -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
     DEPENDS
     DEPENDS
       ${${proj}_DEPENDENCIES}
       ${${proj}_DEPENDENCIES}
     )
     )

+ 4 - 0
Libs/QtTesting/CMakeLists.txt

@@ -150,6 +150,10 @@ set(QtTesting_LIBRARIES QtTesting)
 # The following macro will read the target libraries from the file 'target_libraries.cmake'
 # The following macro will read the target libraries from the file 'target_libraries.cmake'
 ctkFunctionGetTargetLibraries(KIT_target_libraries)
 ctkFunctionGetTargetLibraries(KIT_target_libraries)
 
 
+if(CTK_QT_VERSION VERSION_GREATER "4")
+  list(APPEND KIT_target_libraries Qt5::Xml Qt5::XmlPatterns)
+endif()
+
 ctkMacroBuildLib(
 ctkMacroBuildLib(
   NAME ${PROJECT_NAME}
   NAME ${PROJECT_NAME}
   EXPORT_DIRECTIVE ${KIT_export_directive}
   EXPORT_DIRECTIVE ${KIT_export_directive}

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

@@ -250,7 +250,11 @@ add_executable(${KIT}CppTests ${Tests} ${Tests_SRCS} ${Tests_MOC_CPP} ${Tests_UI
 target_link_libraries(${KIT}CppTests ${LIBRARY_NAME})
 target_link_libraries(${KIT}CppTests ${LIBRARY_NAME})
 
 
 if(CTK_QT_VERSION VERSION_GREATER "4")
 if(CTK_QT_VERSION VERSION_GREATER "4")
-  target_link_libraries(${KIT}CppTests Qt5::Test)
+  list(APPEND KIT_target_libraries Qt5::Test)
+  if(CTK_USE_QTTESTING)
+    list(APPEND KIT_target_libraries Qt5::Xml Qt5::XmlPatterns)
+  endif()
+  target_link_libraries(${KIT}CppTests ${KIT_target_libraries})
 endif()
 endif()
 
 
 #
 #

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkActionsWidgetEventTranslatorPlayerTest1.cpp

@@ -77,7 +77,7 @@ int ctkActionsWidgetEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkAddRemoveComboBoxEventTranslatorPlayerTest1.cpp

@@ -70,7 +70,7 @@ int ctkAddRemoveComboBoxEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkAxesWidgetEventTranslatorPlayerTest1.cpp

@@ -84,7 +84,7 @@ int ctkAxesWidgetEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState2);
                         &checkFinalWidgetState2);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkButtonGroupEventTranslatorPlayerTest1.cpp

@@ -116,7 +116,7 @@ int ctkButtonGroupEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkCheckableComboBoxEventTranslatorPlayerTest1.cpp

@@ -116,7 +116,7 @@ int ctkCheckableComboBoxEventTranslatorPlayerTest1(int argc, char * argv [])
                         &checkFinalWidgetState2);
                         &checkFinalWidgetState2);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 10 - 2
Libs/Widgets/Testing/Cpp/ctkCheckableHeaderViewEventTranslatorPlayerTest1.cpp

@@ -106,12 +106,20 @@ int ctkCheckableHeaderViewEventTranslatorPlayerTest1(int argc, char * argv [] )
   model.setHeaderData(0, Qt::Horizontal, Qt::Checked, Qt::CheckStateRole);
   model.setHeaderData(0, Qt::Horizontal, Qt::Checked, Qt::CheckStateRole);
 
 
   QHeaderView* previousHeaderView = table.horizontalHeader();
   QHeaderView* previousHeaderView = table.horizontalHeader();
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
   bool oldClickable = previousHeaderView->isClickable();
   bool oldClickable = previousHeaderView->isClickable();
-
+#else
+  bool oldClickable = previousHeaderView->sectionsClickable();
+#endif
   ctkCheckableHeaderView* headerView =
   ctkCheckableHeaderView* headerView =
     new ctkCheckableHeaderView(Qt::Horizontal, &table);
     new ctkCheckableHeaderView(Qt::Horizontal, &table);
+#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
   headerView->setClickable(oldClickable);
   headerView->setClickable(oldClickable);
   headerView->setMovable(previousHeaderView->isMovable());
   headerView->setMovable(previousHeaderView->isMovable());
+#else
+  headerView->setSectionsClickable(oldClickable);
+  headerView->setSectionsMovable(previousHeaderView->sectionsMovable());
+#endif
   headerView->setHighlightSections(previousHeaderView->highlightSections());
   headerView->setHighlightSections(previousHeaderView->highlightSections());
   // propagatetoitems is true by default
   // propagatetoitems is true by default
   //headerView->setPropagateToItems(true);
   //headerView->setPropagateToItems(true);
@@ -131,7 +139,7 @@ int ctkCheckableHeaderViewEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkCheckablePushButtonEventTranslatorPlayerTest1.cpp

@@ -136,7 +136,7 @@ int ctkCheckablePushButtonEventTranslatorPlayerTest1(int argc, char * argv [])
                         &checkFinalWidgetState3);
                         &checkFinalWidgetState3);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkCollapsibleButtonEventTranslatorPlayerTest1.cpp

@@ -92,7 +92,7 @@ int ctkCollapsibleButtonEventTranslatorPlayerTest1(int argc, char * argv [])
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkCollapsibleGroupBoxEventTranslatorPlayerTest1.cpp

@@ -120,7 +120,7 @@ int ctkCollapsibleGroupBoxEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 3 - 3
Libs/Widgets/Testing/Cpp/ctkColorDialogEventTranslatorPlayerTest1.cpp

@@ -46,8 +46,8 @@ void checkFinalWidgetState(void* data)
   {
   {
   ctkColorDialog* widget = reinterpret_cast<ctkColorDialog*>(data);
   ctkColorDialog* widget = reinterpret_cast<ctkColorDialog*>(data);
 
 
-  CTKCOMPARE(QColor::fromRgb(widget->customColor(0)), QColor::fromRgb(0,255,127));
-  CTKCOMPARE(QColor::fromRgb(widget->customColor(2)), QColor::fromRgb(255,255,255));
+  CTKCOMPARE(widget->customColor(0), QColor::fromRgb(0,255,127));
+  CTKCOMPARE(widget->customColor(2), QColor::fromRgb(255,255,255));
   CTKCOMPARE(widget->selectedColor(), QColor(128, 255, 60));
   CTKCOMPARE(widget->selectedColor(), QColor(128, 255, 60));
   }
   }
 }
 }
@@ -71,7 +71,7 @@ int ctkColorDialogEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkColorPickerButtonEventTranslatorPlayerTest1.cpp

@@ -129,7 +129,7 @@ int ctkColorPickerButtonEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState3);
                         &checkFinalWidgetState3);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkComboBoxEventTranslatorPlayerTest1.cpp

@@ -75,7 +75,7 @@ int ctkComboBoxEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkConsoleEventTranslatorPlayerTest1.cpp

@@ -72,7 +72,7 @@ int ctkConsoleEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkCoordinatesWidgetEventTranslatorPlayerTest1.cpp

@@ -71,7 +71,7 @@ int ctkCoordinatesWidgetEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkDirectoryButtonEventTranslatorPlayerTest1.cpp

@@ -69,7 +69,7 @@ int ctkDirectoryButtonEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkDoubleRangeSliderEventTranslatorPlayerTest1.cpp

@@ -107,7 +107,7 @@ int ctkDoubleRangeSliderEventTranslatorPlayerTest1(int argc, char * argv [])
                         &checkFinalWidgetState3);
                         &checkFinalWidgetState3);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkDoubleSliderEventTranslatorPlayerTest1.cpp

@@ -89,7 +89,7 @@ int ctkDoubleSliderEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState3);
                         &checkFinalWidgetState3);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkExpandButtonEventTranslatorPlayerTest1.cpp

@@ -122,7 +122,7 @@ int ctkExpandButtonEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkFileDialogEventTranslatorPlayerTest1.cpp

@@ -148,7 +148,7 @@ int ctkFileDialogEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState3);
                         &checkFinalWidgetState3);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkFontButtonEventTranslatorPlayerTest1.cpp

@@ -94,7 +94,7 @@ int ctkFontButtonEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState2);
                         &checkFinalWidgetState2);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkMaterialPropertyWidgetEventTranslatorPlayerTest1.cpp

@@ -92,7 +92,7 @@ int ctkMaterialPropertyWidgetEventTranslatorPlayerTest1(int argc, char * argv []
                         &checkFinalWidgetState2);
                         &checkFinalWidgetState2);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkMatrixWidgetEventTranslatorPlayerTest1.cpp

@@ -76,7 +76,7 @@ int ctkMatrixWidgetEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkMenuButtonEventTranslatorPlayerTest1.cpp

@@ -99,7 +99,7 @@ int ctkMenuButtonEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkMenuComboBoxEventTranslatorPlayerTest1.cpp

@@ -165,7 +165,7 @@ int ctkMenuComboBoxEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState2);
                         &checkFinalWidgetState2);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkMenuEventTranslatorPlayerTest1.cpp

@@ -155,7 +155,7 @@ int ctkMenuEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkModalityWidgetEventTranslatorPlayerTest1.cpp

@@ -71,7 +71,7 @@ int ctkModalityWidgetEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkPathLineEditEventTranslatorPlayerTest1.cpp

@@ -93,7 +93,7 @@ int ctkPathLineEditEventTranslatorPlayerTest1(int argc, char * argv [] )
                         xmlDirectory + "ctkPathLineEditEventTranslatorPlayerTest2.xml",
                         xmlDirectory + "ctkPathLineEditEventTranslatorPlayerTest2.xml",
                         &checkFinalWidgetState2);
                         &checkFinalWidgetState2);
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkPopupWidgetEventTranslatorPlayerTest1.cpp

@@ -118,7 +118,7 @@ int ctkPopupWidgetEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkRangeSliderEventTranslatorPlayerTest1.cpp

@@ -92,7 +92,7 @@ int ctkRangeSliderEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState2);
                         &checkFinalWidgetState2);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkRangeWidgetEventTranslatorPlayerTest1.cpp

@@ -91,7 +91,7 @@ int ctkRangeWidgetEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState2);
                         &checkFinalWidgetState2);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkSearchBoxEventTranslatorPlayerTest1.cpp

@@ -79,7 +79,7 @@ int ctkSearchBoxEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkSettingsDialogEventTranslatorPlayerTest1.cpp

@@ -92,7 +92,7 @@ int ctkSettingsDialogEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkSliderWidgetEventTranslatorPlayerTest1.cpp

@@ -70,7 +70,7 @@ int ctkSliderWidgetEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState);
                         &checkFinalWidgetState);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }

+ 1 - 1
Libs/Widgets/Testing/Cpp/ctkTreeComboBoxEventTranslatorPlayerTest1.cpp

@@ -130,7 +130,7 @@ int ctkTreeComboBoxEventTranslatorPlayerTest1(int argc, char * argv [] )
                         &checkFinalWidgetState2);
                         &checkFinalWidgetState2);
 
 
   // ------------------------
   // ------------------------
-  if (!app.arguments().contains("-I"))
+  if (argc < 2 || QString(argv[1]) != "-I")
     {
     {
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     QTimer::singleShot(0, &etpWidget, SLOT(play()));
     }
     }