diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-12-07 14:17:02 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-06 17:07:59 +0000 |
commit | cf27d9e8a5e14ebe083f4b0fa2204d0646e7ed5e (patch) | |
tree | 56ab889591e8cdb919f9b5b3ac6a46af6126a2da /examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp | |
parent | 283008e123e5eacb83869682528b2024186634f8 (diff) |
Cleanup Widgets examples - new signal/slot syntax
Cleanup the Widget examples - use the new signal/slot syntax where
possible - painting and richtext subdirectory
Change-Id: If0e365ab1cabf9184076595494cfca151406fddf
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp')
-rw-r--r-- | examples/widgets/richtext/syntaxhighlighter/mainwindow.cpp | 13 |
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); } |