summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-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