Repair tst_qabstractitemview in case of no cursor

tst_qabstractitemview requires a movable cursor.
This patch skips the test if there is no movable cursor.

Pick-to: 6.2 6.3
Fixes: QTBUG-87400
Change-Id: I4e917b2ad062ce068f23603410aa9209edb9828d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
bb10
Andreas Buhr 2022-02-15 14:17:12 +01:00
parent e87233fbd8
commit 9beca76786
2 changed files with 7 additions and 6 deletions

View File

@ -1,5 +0,0 @@
[task200665_itemEntered]
macos # Can't move cursor (QTBUG-76312)
# QTBUG-87400
[task200665_itemEntered]
android

View File

@ -1358,7 +1358,13 @@ void tst_QAbstractItemView::task200665_itemEntered()
{
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
{
// skip if we can't move mouse
const QPoint cursorPos = QCursor::pos() + QPoint(10, 10);
QCursor::setPos(cursorPos);
if (!QTest::qWaitFor([cursorPos] { return QCursor::pos() == cursorPos; }, 500))
QSKIP("Can't move mouse");
}
//we test that view will emit entered
//when the scrollbar move but not the mouse itself
QStandardItemModel model(1000, 1);