diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2020-01-22 13:47:08 +0100 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2020-01-24 13:17:33 +0100 |
commit | 502d3d6744913899da87acfda5ebdab42c40329e (patch) | |
tree | 16658a328503bfd5a62b4fd5d69ffb66e9854b18 /tests/auto/widgets/widgets/qmenubar | |
parent | d1be8b9ceb2c7b20bbe53a07154c79699540ea3d (diff) | |
parent | 06bb315beb6c2c398223cfe52cbc7f66e14a8557 (diff) |
Merge remote-tracking branch 'origin/dev' into merge-dev
Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
Diffstat (limited to 'tests/auto/widgets/widgets/qmenubar')
-rw-r--r-- | tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp index 8b372a78cf..8cbe821a68 100644 --- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp @@ -1267,7 +1267,7 @@ void tst_QMenuBar::check_menuPosition() const QPoint bottomRight = mb->actionGeometry(menu.menuAction()).bottomRight() - QPoint(1, 1); const QPoint localPos = widgetToWindowPos(mb, bottomRight); const QPoint globalPos = w.mapToGlobal(localPos); - QTest::mouseClick(w.windowHandle(), Qt::LeftButton, 0, localPos); + QTest::mouseClick(w.windowHandle(), Qt::LeftButton, {}, localPos); QTRY_VERIFY(menu.isActiveWindow()); QCOMPARE(menu.geometry().right() - 1, globalPos.x()); menu.close(); @@ -1332,9 +1332,9 @@ void tst_QMenuBar::task256322_highlight() const QPoint filePos = menuBarActionWindowPos(win.menuBar(), file); QWindow *window = win.windowHandle(); - QTest::mousePress(window, Qt::LeftButton, 0, filePos); + QTest::mousePress(window, Qt::LeftButton, {}, filePos); QTest::mouseMove(window, filePos); - QTest::mouseRelease(window, Qt::LeftButton, 0, filePos); + QTest::mouseRelease(window, Qt::LeftButton, {}, filePos); QTRY_VERIFY(menu.isVisible()); QVERIFY(!menu2.isVisible()); QCOMPARE(win.menuBar()->activeAction(), file); @@ -1507,11 +1507,11 @@ void tst_QMenuBar::closeOnSecondClickAndOpenOnThirdClick() // QTBUG-32807, menu QWindow *window = mainWindow.windowHandle(); QTest::mouseMove(window, center); - QTest::mouseClick(window, Qt::LeftButton, 0, center); + QTest::mouseClick(window, Qt::LeftButton, {}, center); QTRY_VERIFY(fileMenu->isVisible()); - QTest::mouseClick(window, Qt::LeftButton, 0, fileMenu->mapFromGlobal(globalPos)); + QTest::mouseClick(window, Qt::LeftButton, {}, fileMenu->mapFromGlobal(globalPos)); QTRY_VERIFY(!fileMenu->isVisible()); - QTest::mouseClick(window, Qt::LeftButton, 0, center); + QTest::mouseClick(window, Qt::LeftButton, {}, center); QTRY_VERIFY(fileMenu->isVisible()); } @@ -1600,12 +1600,12 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested() QApplication::setActiveWindow(&mainWindow); // they can't be windows - QWidget hiddenParent(&mainWindow, 0); + QWidget hiddenParent(&mainWindow, {}); //this one is going to be moved around - QWidget movingParent(&hiddenParent, 0); + QWidget movingParent(&hiddenParent, {}); //set up the container widget - QWidget containerWidget(&movingParent,0); + QWidget containerWidget(&movingParent, {}); //set the new parent, a window QScopedPointer<QWidget> windowedParent; @@ -1616,7 +1616,7 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested() QVERIFY(QTest::qWaitForWindowExposed(windowedParent.data())); //set the "container", can't be a window - QWidget containedWidget(&containerWidget, 0); + QWidget containedWidget(&containerWidget, {}); taskQTBUG53205MenuBar = new QMenuBar(&containedWidget); @@ -1624,13 +1624,13 @@ void tst_QMenuBar::taskQTBUG53205_crashReparentNested() //now, move things around //from : QMainWindow<-hiddenParent<-movingParent<-containerWidget<-containedWidget<-menuBar //to windowedParent<-movingParent<-containerWidget<-containedWidget<-menuBar - movingParent.setParent(windowedParent.data(),0); + movingParent.setParent(windowedParent.data(), {}); // this resets the parenting and the menu bar's window taskQTBUG53205MenuBar->setParent(nullptr); taskQTBUG53205MenuBar->setParent(&containedWidget); //from windowedParent<-movingParent<-containerWidget<-containedWidget<-menuBar //to : QMainWindow<-hiddenParent<-movingParent<-containerWidget<-containedWidget<-menuBar - movingParent.setParent(&hiddenParent,0); + movingParent.setParent(&hiddenParent, {}); windowedParent.reset(); //make the old window invalid // trigger the aciton, reset the menu bar's window, this used to crash here. testMenus.actions[0]->trigger(); |