Move cursor out of the way before running test
Without this change, the test fails when run twice in a row. Also, skip the test if we can't move the cursor. Pick-to: 6.3 Change-Id: Ic45c073007d114fbd7825cedef6761c1e410b4af Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>bb10
parent
e27e3ad546
commit
3f5a424264
|
|
@ -1060,12 +1060,16 @@ public:
|
|||
// Mouse move related signals for Windows Mobile unavailable
|
||||
void tst_QMenu::task258920_mouseBorder()
|
||||
{
|
||||
const QRect screenGeometry = QGuiApplication::primaryScreen()->availableGeometry();
|
||||
Menu258920 menu;
|
||||
QCursor::setPos(screenGeometry.topLeft());
|
||||
if (!QTest::qWaitFor([screenGeometry]{ return QCursor::pos() == screenGeometry.topLeft(); }))
|
||||
QSKIP("Can't move cursor out of the way");
|
||||
// For styles which inherit from QWindowsStyle, styleHint(QStyle::SH_Menu_MouseTracking) is true.
|
||||
menu.setMouseTracking(true);
|
||||
QAction *action = menu.addAction("test");
|
||||
|
||||
const QPoint center = QGuiApplication::primaryScreen()->availableGeometry().center();
|
||||
const QPoint center = screenGeometry.center();
|
||||
menu.popup(center);
|
||||
QVERIFY(QTest::qWaitForWindowExposed(&menu));
|
||||
QRect actionRect = menu.actionGeometry(action);
|
||||
|
|
|
|||
Loading…
Reference in New Issue