diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-02-05 11:52:37 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-02-05 11:54:27 (GMT) |
commit | 7a300d4d3a89d7002643bd7e70b1525d72967681 (patch) | |
tree | 7399b5e14be29a66ee9855fb25abce0de5b2caba /tests/auto/qgraphicsscene | |
parent | 3baf7b981a8f40ed13c2ffb62d2188a16005f69c (diff) | |
download | Qt-7a300d4d3a89d7002643bd7e70b1525d72967681.zip Qt-7a300d4d3a89d7002643bd7e70b1525d72967681.tar.gz Qt-7a300d4d3a89d7002643bd7e70b1525d72967681.tar.bz2 |
Fixed the context menu test case in the qgraphicsscene autotest.
When creating a custom QContextMenuEvent to send to a viewport we should use
the viewport to convert the mouse cursor position to screen coordinates.
Reviewed-by: Olivier Goffart
Diffstat (limited to 'tests/auto/qgraphicsscene')
-rw-r--r-- | tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp index 6743fbe..469ded0 100644 --- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp +++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp @@ -2806,14 +2806,14 @@ void tst_QGraphicsScene::contextMenuEvent_ItemIgnoresTransformations() { QPoint pos(50, 50); - QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.mapToGlobal(pos)); + QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.viewport()->mapToGlobal(pos)); event.ignore(); QApplication::sendEvent(view.viewport(), &event); QVERIFY(event.isAccepted()); } { QPoint pos(150, 150); - QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.mapToGlobal(pos)); + QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.viewport()->mapToGlobal(pos)); event.ignore(); QApplication::sendEvent(view.viewport(), &event); QVERIFY(!event.isAccepted()); @@ -2821,14 +2821,14 @@ void tst_QGraphicsScene::contextMenuEvent_ItemIgnoresTransformations() view.scale(1.5, 1.5); { QPoint pos(25, 25); - QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.mapToGlobal(pos)); + QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.viewport()->mapToGlobal(pos)); event.ignore(); QApplication::sendEvent(view.viewport(), &event); QVERIFY(event.isAccepted()); } { QPoint pos(55, 55); - QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.mapToGlobal(pos)); + QContextMenuEvent event(QContextMenuEvent::Keyboard, pos, view.viewport()->mapToGlobal(pos)); event.ignore(); QApplication::sendEvent(view.viewport(), &event); QVERIFY(!event.isAccepted()); |