diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-05 10:03:49 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-04-08 12:16:23 +0000 |
commit | 5a5441f38e0529d852536b776cd9f26dad410e62 (patch) | |
tree | d1a5560c13f6f6e9e2bb27ae7de1619c6d216e39 /tests/auto/quick/qquickmultipointtoucharea | |
parent | 0a9491d6ca95e2fdeb6c1eaef35beaa095eace5a (diff) |
Tests: Fix warnings about ignoring return value of QTest::qWaitForWindowExposed()
Fix warnings like:
../shared/particlestestsshared.h: In function 'QQuickView* createView(const QUrl&, int)':
../shared/particlestestsshared.h:64:33: warning: ignoring return value of 'bool QTest::qWaitForWindowExposed(QWindow*, int)', declared with attribute nodiscard [-Wunused-result]
by checking the return and adding some handling.
Change-Id: I1390f9738430042fcc45e243567a9d5a4f632a6d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickmultipointtoucharea')
-rw-r--r-- | tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp b/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp index d4ad282701..cd66fc4ede 100644 --- a/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp +++ b/tests/auto/quick/qquickmultipointtoucharea/tst_qquickmultipointtoucharea.cpp @@ -1145,16 +1145,18 @@ void tst_QQuickMultiPointTouchArea::transformedTouchArea() QQuickView *tst_QQuickMultiPointTouchArea::createAndShowView(const QString &file) { - QQuickView *window = new QQuickView(nullptr); + QScopedPointer<QQuickView> window(new QQuickView(nullptr)); window->setSource(testFileUrl(file)); + if (window->status() != QQuickView::Ready) + return nullptr; const QRect screenGeometry = window->screen()->availableGeometry(); const QSize size = window->size(); const QPoint offset = QPoint(size.width() / 2, size.height() / 2); window->setFramePosition(screenGeometry.center() - offset); window->show(); - QTest::qWaitForWindowExposed(window); - - return window; + if (!QTest::qWaitForWindowExposed(window.data())) + return nullptr; + return window.take(); } void tst_QQuickMultiPointTouchArea::mouseInteraction_data() |