diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-10-04 21:11:18 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2023-10-05 19:08:45 +0000 |
commit | 9ed25b413ff2e5055ec03fd6e1f8ba5dfcfc499a (patch) | |
tree | d6bfb76ab9f1b44b977559791fbbc68525d35d1d /tests/auto/widgets/itemviews | |
parent | 91873485050dc1d9b7c4ca4b663e8d1c8138c26c (diff) |
Tests/QListView: fix internalDragDropMove test for openSUSE
On some xcb platforms the xcb_configure_notify_event_t is sent after the
window is fully exposed which leads to a wrong position for
QWidget::mapToGlobal() which makes the test fail.
Fix it by waiting for a move event with a position != 0,0 before
starting the drag'n'drop operation.
Fixes: QTBUG-94250
Change-Id: If91a15815205ba9dcea36248d9de03ed0a7e5822
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'tests/auto/widgets/itemviews')
-rw-r--r-- | tests/auto/widgets/itemviews/qlistview/BLACKLIST | 3 | ||||
-rw-r--r-- | tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/auto/widgets/itemviews/qlistview/BLACKLIST b/tests/auto/widgets/itemviews/qlistview/BLACKLIST deleted file mode 100644 index ec1c3722bd..0000000000 --- a/tests/auto/widgets/itemviews/qlistview/BLACKLIST +++ /dev/null @@ -1,3 +0,0 @@ -# QTBUG-94250 -[internalDragDropMove] -opensuse-leap diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index 2b908d4d4f..93e6080968 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -68,8 +68,14 @@ public: { return QListView::visualRegionForSelection(selectionModel()->selection()); } + void moveEvent(QMoveEvent *e) override + { + QListView::moveEvent(e); + m_gotValidResizeEvent = !e->pos().isNull(); + } friend class tst_QListView; + bool m_gotValidResizeEvent = false; }; class tst_QListView : public QObject @@ -2995,6 +3001,7 @@ void tst_QListView::internalDragDropMove() // The test relies on the global position of mouse events; make sure // the window is properly mapped on X11. QVERIFY(QTest::qWaitForWindowActive(&list)); + QVERIFY(QTest::qWaitFor([&]() { return list.m_gotValidResizeEvent; })); // execute as soon as the eventloop is running again // which is the case inside list.startDrag() QTimer::singleShot(0, [&]() |