summaryrefslogtreecommitdiffstats
path: root/examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp')
-rw-r--r--examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp b/examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp
index dd58f1f45b..2dba0ba73e 100644
--- a/examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp
+++ b/examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp
@@ -117,9 +117,12 @@ void MainWindow::setupFileMenu()
QMenu *fileMenu = new QMenu(tr("&File"), this);
menuBar()->addMenu(fileMenu);
- fileMenu->addAction(tr("&New"), this, SLOT(newFile()), QKeySequence::New);
- fileMenu->addAction(tr("&Open..."), this, SLOT(openFile()), QKeySequence::Open);
- fileMenu->addAction(tr("E&xit"), qApp, SLOT(quit()), QKeySequence::Quit);
+ fileMenu->addAction(tr("&New"), this,
+ &MainWindow::newFile, QKeySequence::New);
+ fileMenu->addAction(tr("&Open..."),
+ this, [this](){ openFile(); }, QKeySequence::Open);
+ fileMenu->addAction(tr("E&xit"), qApp,
+ &QApplication::quit, QKeySequence::Quit);
}
void MainWindow::setupHelpMenu()
@@ -127,6 +130,6 @@ void MainWindow::setupHelpMenu()
QMenu *helpMenu = new QMenu(tr("&Help"), this);
menuBar()->addMenu(helpMenu);
- helpMenu->addAction(tr("&About"), this, SLOT(about()));
- helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
+ helpMenu->addAction(tr("&About"), this, &MainWindow::about);
+ helpMenu->addAction(tr("About &Qt"), qApp, &QApplication::aboutQt);
}