浏览代码

Merge branch 'fix-qt5-build-warnings-and-errors'

* fix-qt5-build-warnings-and-errors:
  VTK/Core/Testing: Fix "No relevant classes found" build warning
  Widgets: Fix Qt5 "unused-result" build warnings associated with qWaitForWindowActive
  XNAT: Fix Qt5 build error related to ambiguous call to QStringRef::compare
Jean-Christophe Fillion-Robin 7 年之前
父节点
当前提交
ab49e97612

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

@@ -42,15 +42,9 @@ set(KIT_HELPER_SRCS
 
 if(CTK_QT_VERSION VERSION_GREATER "4")
   QT5_WRAP_CPP(KIT_HELPER_SRCS ctkVTKObjectTestHelper.h)
-  QT5_GENERATE_MOCS(
-    ctkVTKConnectionTestObjectDelete.cpp
-    )
   include_directories(${Qt5Widgets_INCLUDE_DIRS})
 else()
   QT4_WRAP_CPP(KIT_HELPER_SRCS ctkVTKObjectTestHelper.h)
-  QT4_GENERATE_MOCS(
-    ctkVTKConnectionTestObjectDelete.cpp
-    )
 endif()
 
 #

+ 0 - 2
Libs/Visualization/VTK/Core/Testing/Cpp/ctkVTKConnectionTestObjectDelete.cpp

@@ -41,8 +41,6 @@
 #include <cstdlib>
 #include <iostream>
 
-#include "moc_ctkVTKConnectionTestObjectDelete.cpp"
-
 namespace
 {
 

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkColorDialogTest1.cpp

@@ -91,7 +91,8 @@ int ctkColorDialogTest1(int argc, char * argv [] )
   if (argc < 2 || QString(argv[1]) != "-I" )
     {
 #if (QT_VERSION >= 0x50000)
-    QTest::qWaitForWindowActive(&colorDialog);
+    bool result = QTest::qWaitForWindowActive(&colorDialog);
+    Q_UNUSED(result);
 #else
     QTest::qWaitForWindowShown(&colorDialog);
 #endif

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkConsoleTest.cpp

@@ -45,7 +45,8 @@ void ctkConsoleTester::testShow()
   ctkConsole console;
   console.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&console);
+  bool result = QTest::qWaitForWindowActive(&console);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&console);
 #endif

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkDoubleRangeSliderTest.cpp

@@ -46,7 +46,8 @@ void ctkDoubleRangeSliderTester::testUI()
   ctkDoubleRangeSlider slider;
   slider.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&slider);
+  bool result = QTest::qWaitForWindowActive(&slider);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&slider);
 #endif

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkDoubleSliderTest.cpp

@@ -46,7 +46,8 @@ void ctkDoubleSliderTester::testUI()
   ctkDoubleSlider slider;
   slider.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&slider);
+  bool result = QTest::qWaitForWindowActive(&slider);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&slider);
 #endif

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkDoubleSpinBoxTest.cpp

@@ -85,7 +85,8 @@ void ctkDoubleSpinBoxTester::testUI()
   spinBox.setSetMode(ctkDoubleSpinBox::SetAlways);
   spinBox.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&spinBox);
+  bool result = QTest::qWaitForWindowActive(&spinBox);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&spinBox);
 #endif

+ 4 - 2
Libs/Widgets/Testing/Cpp/ctkMatrixWidgetTest.cpp

@@ -46,7 +46,8 @@ void ctkMatrixWidgetTester::testUI()
 
   matrix.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&matrix);
+  bool result = QTest::qWaitForWindowActive(&matrix);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&matrix);
 #endif
@@ -65,7 +66,8 @@ void ctkMatrixWidgetTester::testDecimals()
   matrix.show();
 
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&matrix);
+  bool result = QTest::qWaitForWindowActive(&matrix);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&matrix);
 #endif

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkPathListWidgetWithButtonsTest.cpp

@@ -68,7 +68,8 @@ void ctkPathListWidgetWithButtonsTester::testButtons()
 
   topLevel.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&topLevel);
+  bool result = QTest::qWaitForWindowActive(&topLevel);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&topLevel);
 #endif

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkPushButtonTest.cpp

@@ -56,7 +56,8 @@ void ctkPushButtonTester::testDefaults()
 
   button.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&button);
+  bool result = QTest::qWaitForWindowActive(&button);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&button);
 #endif

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkRangeSliderTest.cpp

@@ -164,7 +164,8 @@ void ctkRangeSliderTester::testHandleMouseEvents()
 
   rangeSlider.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&rangeSlider);
+  bool result = QTest::qWaitForWindowActive(&rangeSlider);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&rangeSlider);
 #endif

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkRangeWidgetTest.cpp

@@ -59,7 +59,8 @@ void ctkRangeWidgetTester::testUI()
   ctkRangeWidget rangeWidget;
   rangeWidget.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&rangeWidget);
+  bool result = QTest::qWaitForWindowActive(&rangeWidget);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&rangeWidget);
 #endif

+ 2 - 1
Libs/Widgets/Testing/Cpp/ctkSearchBoxTest.cpp

@@ -42,7 +42,8 @@ void ctkSearchBoxTester::testSignals()
   ctkSearchBox searchBox;
   searchBox.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&searchBox);
+  bool result = QTest::qWaitForWindowActive(&searchBox);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&searchBox);
 #endif

+ 6 - 3
Libs/Widgets/Testing/Cpp/ctkSliderWidgetTest.cpp

@@ -67,7 +67,8 @@ void ctkSliderWidgetTester::testUI()
   slider.setPrefix("A: ");
   slider.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&slider);
+  bool result = QTest::qWaitForWindowActive(&slider);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&slider);
 #endif
@@ -165,7 +166,8 @@ void ctkSliderWidgetTester::testDecimalsByShortcuts()
 
   slider.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&slider);
+  bool result = QTest::qWaitForWindowActive(&slider);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&slider);
 #endif
@@ -190,7 +192,8 @@ void ctkSliderWidgetTester::testValueChangedWithNoTracking()
 
   slider.show();
 #if (QT_VERSION >= 0x50000)
-  QTest::qWaitForWindowActive(&slider);
+  bool result = QTest::qWaitForWindowActive(&slider);
+  Q_UNUSED(result);
 #else
   QTest::qWaitForWindowShown(&slider);
 #endif

+ 1 - 1
Libs/XNAT/Core/ctkXnatResourceCatalogXmlParser.cpp

@@ -57,7 +57,7 @@ void ctkXnatResourceCatalogXmlParser::parseXml(QList<QVariantMap>& result)
 
   while (!d->xmlReader.atEnd())
   {
-    if (d->xmlReader.name().compare("entry") == 0)
+    if (d->xmlReader.name().compare(QLatin1String("entry")) == 0)
     {
       QVariantMap map;
       QXmlStreamAttributes attributes = d->xmlReader.attributes();