Examples: "About &Qt" should show info about Qt, not quit

A few examples seem to have copied and pasted a help action "About
&Qt" that triggered QCoreApplication::quit. This does not look like
best practice. Use QApplication::aboutQt instead.

Pick-to: 6.6 6.5
Task-number: QTBUG-111228
Change-Id: I1887a3c999d752a24c7c4d3cabc4a5d63b29b966
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Edward Welbourne 2023-06-14 16:18:32 +02:00
parent 59d2869765
commit 3ccf2f8308
3 changed files with 3 additions and 3 deletions

View File

@ -148,6 +148,6 @@ void MainWindow::createMenus()
QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(tr("&About"), this, &MainWindow::about);
helpMenu->addAction(tr("About &Qt"), qApp, &QCoreApplication::quit);
helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}
//! [5]

View File

@ -151,7 +151,7 @@ void MainWindow::createActions()
QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(tr("&About"), this, &MainWindow::about);
helpMenu->addAction(tr("About &Qt"), qApp, &QCoreApplication::quit);
helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}
void MainWindow::setSettingsObject(const SettingsPtr &settings)

View File

@ -106,6 +106,6 @@ void MainWindow::createMenus()
QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(tr("&About"), this, &MainWindow::about);
helpMenu->addAction(tr("About &Qt"), qApp, &QCoreApplication::quit);
helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}
//! [4]