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:
parent
59d2869765
commit
3ccf2f8308
@ -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]
|
||||
|
@ -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)
|
||||
|
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user