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>
This commit is contained in:
Mitch Curtis 2019-04-25 13:26:41 +02:00
parent e1a6475a2a
commit 8301071b25
2 changed files with 4 additions and 4 deletions

View File

@ -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
}
}
}

View File

@ -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);