summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmenu/tst_qmenu.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-08-25 10:11:49 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2011-08-25 12:48:52 +0200
commit04d0a9626ce61b2e05a40f9562c2bcf12e234639 (patch)
treef1643f829aedc9ac51fcc260f7df2639dfe08360 /tests/auto/qmenu/tst_qmenu.cpp
parent17f3451daa286b88a52f18c802d7b158dfb653b2 (diff)
parentbdc417b3828737334723eae23097c85f70c23a33 (diff)
Merge branch 'master' into refactor
Conflicts: src/gui/kernel/qapplication_qpa.cpp src/gui/kernel/qcursor_qpa.cpp src/gui/kernel/qwindowsysteminterface_qpa.cpp src/gui/kernel/qwindowsysteminterface_qpa.h src/gui/kernel/qwindowsysteminterface_qpa_p.h src/gui/text/qtextcontrol.cpp src/plugins/platforms/wayland/wayland.pro src/widgets/accessible/qaccessible2.h src/widgets/widgets/qwidgetlinecontrol_p.h Change-Id: I5e6f4eb184159dccc67e8f13673edb884d179c74
Diffstat (limited to 'tests/auto/qmenu/tst_qmenu.cpp')
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index b3c41e1c2b..73a74c6d75 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -827,6 +827,9 @@ void tst_QMenu::task258920_mouseBorder()
#ifdef Q_OS_WINCE_WM
QSKIP("Mouse move related signals for Windows Mobile unavailable", SkipAll);
#endif
+#ifdef Q_WS_QPA
+ QSKIP("QTBUG-20753 QCursor::setPos() / QTest::mouseMove() doesn't work on qpa", SkipAll);
+#endif
Menu258920 menu;
// On Symbian, styleHint(QStyle::SH_Menu_MouseTracking) in QS60Style is false.
// For other styles which inherit from QWindowsStyle, the value is true.
@@ -880,12 +883,27 @@ void tst_QMenu::pushButtonPopulateOnAboutToShow()
b.show();
const QRect screen = QApplication::desktop()->screenGeometry(scrNumber);
- b.move(10, screen.bottom()-b.height()-5);
+ QRect desiredGeometry = b.geometry();
+ desiredGeometry.moveTopLeft(QPoint(10, screen.bottom()-b.height()-5));
+
+ b.setGeometry(desiredGeometry);
QTest::qWaitForWindowShown(&b);
+
+ if (b.geometry() != desiredGeometry) {
+ // We are trying to put the button very close to the edge of the screen,
+ // explicitly to test behavior when the popup menu goes off the screen.
+ // However a modern window manager is quite likely to reject this requested geometry
+ // (kwin in kde4 does, for example, since the button would probably appear behind
+ // or partially behind the taskbar).
+ // Your best bet is to run this test _without_ a WM.
+ QSKIP("Your window manager won't allow a window against the bottom of the screen", SkipAll);
+ }
+
QTimer::singleShot(300,lastMenu, SLOT(hide()));
QTest::mouseClick(&b, Qt::LeftButton, Qt::NoModifier, b.rect().center());
QVERIFY(!lastMenu->geometry().intersects(b.geometry()));
+ // note: we're assuming that, if we previously got the desired geometry, we'll get it here too
b.move(10, screen.bottom()-lastMenu->height()-5);
QTimer::singleShot(300,lastMenu, SLOT(hide()));
QTest::mouseClick(&b, Qt::LeftButton, Qt::NoModifier, b.rect().center());