summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-08-06 12:11:53 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-08-06 12:12:55 (GMT)
commit8dbc32699dec7aa928eb9518c05437f481d11a43 (patch)
tree1c65eaab86eca9007b2e2c2be36e40c8a0a520d3
parent13998901f7831beaaeca6ada4def3e29af4e251d (diff)
downloadQt-8dbc32699dec7aa928eb9518c05437f481d11a43.zip
Qt-8dbc32699dec7aa928eb9518c05437f481d11a43.tar.gz
Qt-8dbc32699dec7aa928eb9518c05437f481d11a43.tar.bz2
QMenuBar: autotests fixed
Apperently we don't get the leave event when simply moving the mouse with the testlib
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index f8f536c..3ccd0c8 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -1529,6 +1529,7 @@ void tst_QMenuBar::task223138_triggered()
void tst_QMenuBar::task256322_highlight()
{
QMainWindow win;
+ win.menuBar()->setNativeMenuBar(false); //we can't check the geometry of native menubars
QMenu menu;
QAction *file = win.menuBar()->addMenu(&menu);
file->setText("file");
@@ -1538,7 +1539,7 @@ void tst_QMenuBar::task256322_highlight()
QAction *nothing = win.menuBar()->addAction("nothing");
win.show();
- QTest::qWait(50);
+ QTest::qWait(200);
QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(file).center());
QTest::mouseClick(win.menuBar(), Qt::LeftButton, 0, win.menuBar()->actionGeometry(file).center());
@@ -1551,15 +1552,11 @@ void tst_QMenuBar::task256322_highlight()
QVERIFY(menu2.isVisible());
QCOMPARE(win.menuBar()->activeAction(), file2);
- QTest::mouseMove(win.menuBar(), win.menuBar()->actionGeometry(nothing).center());
+ QPoint nothingCenter = win.menuBar()->actionGeometry(nothing).center();
+ QTest::mouseMove(win.menuBar(), nothingCenter);
QTRY_VERIFY(!menu2.isVisible());
QVERIFY(!menu.isVisible());
QCOMPARE(win.menuBar()->activeAction(), nothing);
-
- QTest::mouseMove(&win, win.menuBar()->geometry().bottomLeft() + QPoint(1,1));
- QTRY_VERIFY(!menu.isVisible());
- QVERIFY(!menu2.isVisible());
- QVERIFY(!win.menuBar()->activeAction());
}
void tst_QMenuBar::menubarSizeHint()
@@ -1586,8 +1583,7 @@ void tst_QMenuBar::menubarSizeHint()
} style;
QMenuBar mb;
- if (mb.isNativeMenuBar())
- QSKIP("we can't check the geometry of native menubars", SkipAll);
+ mb.setNativeMenuBar(false); //we can't check the geometry of native menubars
mb.setStyle(&style);
//this is a list of arbitrary strings so that we check the geometry