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>
This commit is contained in:
parent
9187348505
commit
9ed25b413f
@ -1,3 +0,0 @@
|
|||||||
# QTBUG-94250
|
|
||||||
[internalDragDropMove]
|
|
||||||
opensuse-leap
|
|
@ -68,8 +68,14 @@ public:
|
|||||||
{
|
{
|
||||||
return QListView::visualRegionForSelection(selectionModel()->selection());
|
return QListView::visualRegionForSelection(selectionModel()->selection());
|
||||||
}
|
}
|
||||||
|
void moveEvent(QMoveEvent *e) override
|
||||||
|
{
|
||||||
|
QListView::moveEvent(e);
|
||||||
|
m_gotValidResizeEvent = !e->pos().isNull();
|
||||||
|
}
|
||||||
|
|
||||||
friend class tst_QListView;
|
friend class tst_QListView;
|
||||||
|
bool m_gotValidResizeEvent = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
class tst_QListView : public QObject
|
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 test relies on the global position of mouse events; make sure
|
||||||
// the window is properly mapped on X11.
|
// the window is properly mapped on X11.
|
||||||
QVERIFY(QTest::qWaitForWindowActive(&list));
|
QVERIFY(QTest::qWaitForWindowActive(&list));
|
||||||
|
QVERIFY(QTest::qWaitFor([&]() { return list.m_gotValidResizeEvent; }));
|
||||||
// execute as soon as the eventloop is running again
|
// execute as soon as the eventloop is running again
|
||||||
// which is the case inside list.startDrag()
|
// which is the case inside list.startDrag()
|
||||||
QTimer::singleShot(0, [&]()
|
QTimer::singleShot(0, [&]()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user