summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
index 624e5595..811fcd46 100644
--- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
+++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp
@@ -682,20 +682,21 @@ void tst_QDeclarativeMouseArea::preventContextMenu()
QCOMPARE(eventsReceived.read().toInt(), 0);
QPoint targetPoint = view->mapFromScene(QPoint(80, 80));
+ QPoint targetGlobalPoint = view->viewport()->mapToGlobal(targetPoint);
- QContextMenuEvent fakeEvent1(QContextMenuEvent::Mouse, targetPoint);
+ QContextMenuEvent fakeEvent1(QContextMenuEvent::Mouse, targetPoint, targetGlobalPoint);
QApplication::sendEvent(view->viewport(), &fakeEvent1);
QCOMPARE(eventsReceived.read().toInt(), 0);
mouseAreaEnabled.write(false);
QVERIFY(!mouseAreaEnabled.read().toBool());
- QContextMenuEvent fakeEvent2(QContextMenuEvent::Mouse, targetPoint);
+ QContextMenuEvent fakeEvent2(QContextMenuEvent::Mouse, targetPoint, targetGlobalPoint);
QApplication::sendEvent(view->viewport(), &fakeEvent2);
QCOMPARE(eventsReceived.read().toInt(), 1);
mouseAreaEnabled.write(true);
QVERIFY(mouseAreaEnabled.read().toBool());
- QContextMenuEvent fakeEvent3(QContextMenuEvent::Mouse, targetPoint);
+ QContextMenuEvent fakeEvent3(QContextMenuEvent::Mouse, targetPoint, targetGlobalPoint);
QApplication::sendEvent(view->viewport(), &fakeEvent3);
QCOMPARE(eventsReceived.read().toInt(), 1);
}