diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-04-25 13:26:41 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-05-03 13:06:57 +0000 |
commit | 8301071b25f50a119822519f08af9595b95430fc (patch) | |
tree | 65ccd7b075baf3f92bb9030c9b3cdf6317e4cb73 | |
parent | e1a6475a2a3ea46b2afbc2f154c18b255466dad7 (diff) |
Fix tst_cursor when running in Android emulator
Explicitly set hoverEnabled to true on the ScrollBar to account for
platforms like Android, where the UiEffects style hint does not include
HoverEffect, and hence QQuickControlPrivate::calcHoverEnabled() would
otherwise return false.
Change-Id: Iee2b1f7c3ee8e5caf2a7b4f6695ab4dabd6b4753
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
-rw-r--r-- | tests/auto/cursor/data/scrollbar.qml | 4 | ||||
-rw-r--r-- | tests/auto/cursor/tst_cursor.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/cursor/data/scrollbar.qml b/tests/auto/cursor/data/scrollbar.qml index 41fda945..50b785c6 100644 --- a/tests/auto/cursor/data/scrollbar.qml +++ b/tests/auto/cursor/data/scrollbar.qml @@ -65,6 +65,10 @@ ApplicationWindow { } ScrollBar.vertical: ScrollBar { id: scrollBar + // Need to explicitly set this to account for platforms like Android, + // where the UiEffects style hint does not include HoverEffect, and + // hence QQuickControlPrivate::calcHoverEnabled() would otherwise return false. + hoverEnabled: true } } } diff --git a/tests/auto/cursor/tst_cursor.cpp b/tests/auto/cursor/tst_cursor.cpp index d59e7091..2491a972 100644 --- a/tests/auto/cursor/tst_cursor.cpp +++ b/tests/auto/cursor/tst_cursor.cpp @@ -202,10 +202,6 @@ void tst_cursor::scrollBar() const QPoint scrollBarPos(window->width() - scrollBar->width() / 2, window->height() / 2); QTest::mouseMove(window, scrollBarPos); - if ((QGuiApplication::platformName() == QLatin1String("offscreen")) - || (QGuiApplication::platformName() == QLatin1String("minimal"))) - QEXPECT_FAIL("", "Active status behaves differently in offscreen/minimal platforms", Continue); - QVERIFY(scrollBar->isActive()); QCOMPARE(window->cursor().shape(), scrollBar->cursor().shape()); QCOMPARE(scrollBar->cursor().shape(), Qt::CursorShape::ArrowCursor); |