diff options
author | Liang QI <liang.qi@nokia.com> | 2009-10-16 14:20:31 (GMT) |
---|---|---|
committer | Liang QI <liang.qi@nokia.com> | 2009-10-16 14:20:31 (GMT) |
commit | 06d1c12c24c38b0cd8822b1faf2694c7331f75cb (patch) | |
tree | 84e883170359e35e702f260f5d8b5633e1d9ea72 /tests | |
parent | 701c8a61f81cd691a071fce90f9c4c138edbfcf9 (diff) | |
download | Qt-06d1c12c24c38b0cd8822b1faf2694c7331f75cb.zip Qt-06d1c12c24c38b0cd8822b1faf2694c7331f75cb.tar.gz Qt-06d1c12c24c38b0cd8822b1faf2694c7331f75cb.tar.bz2 |
Fix tst_QMenu on Symbian.
For tst_QMenu::activeSubMenuPosition, QS60Style::pixelMetric(QStyle::PM_SubMenuOverlap) is different with other styles.
For tst_QMenu::menuSizeHint, Softkey actions are not widgets and have no geometry.
For tst_QMenu::task258920_mouseBorder, QS60Style::styleHint(QStyle::SH_Menu_MouseTracking) is false.
RevBy: Shane Kearns
RevBy: axis
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qmenu/tst_qmenu.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index 4eb149f..f12fa92 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -675,7 +675,13 @@ void tst_QMenu::activeSubMenuPosition() #ifdef Q_OS_WINCE_WM QSKIP("Not true for Windows Mobile Soft Keys", SkipSingle); #endif + +#ifdef Q_OS_SYMBIAN + // On Symbian, QS60Style::pixelMetric(QStyle::PM_SubMenuOverlap) is different with other styles. + QVERIFY(sub->pos().x() < main->pos().x()); +#else QVERIFY(sub->pos().x() > main->pos().x()); +#endif QCOMPARE(sub->activeAction(), subAction); } @@ -778,6 +784,11 @@ void tst_QMenu::menuSizeHint() int maxWidth =0; QRect result; foreach(QAction *action, menu.actions()) { +#ifdef QT_SOFTKEYS_ENABLED + // Softkey actions are not widgets and have no geometry. + if (menu.actionGeometry(action).topLeft() == QPoint(0,0)) + continue; +#endif maxWidth = qMax(maxWidth, menu.actionGeometry(action).width()); result |= menu.actionGeometry(action); QCOMPARE(result.x(), left + hmargin + panelWidth); @@ -816,6 +827,9 @@ void tst_QMenu::task258920_mouseBorder() QSKIP("Mouse move related signals for Windows Mobile unavailable", 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. + menu.setMouseTracking(true); QAction *action = menu.addAction("test"); menu.popup(QApplication::desktop()->availableGeometry().center()); |