diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-12-07 14:17:38 +0100 |
---|---|---|
committer | Luca Beldi <v.ronin@yahoo.it> | 2019-01-03 08:29:56 +0000 |
commit | 8c04aab8966611e96c64f469b7a1c6afe67e3fca (patch) | |
tree | 40fe2bc3f4d945a65828d49586292ea6c72440a1 /examples/widgets/touch/fingerpaint/mainwindow.cpp | |
parent | 451ebdff824cad329b40aad9a10cec5e5cb464cc (diff) |
Cleanup Widgets examples - new signal/slot syntax
Cleanup the Widget examples - use the new signal/slot syntax where
possible - layout, statemachine, tools and touch subdirectory
Change-Id: I466b309b643ef7ffc27be7591fa10f4c75cfd3f8
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples/widgets/touch/fingerpaint/mainwindow.cpp')
-rw-r--r-- | examples/widgets/touch/fingerpaint/mainwindow.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/widgets/touch/fingerpaint/mainwindow.cpp b/examples/widgets/touch/fingerpaint/mainwindow.cpp index 0e45eea240..b0d91d25bf 100644 --- a/examples/widgets/touch/fingerpaint/mainwindow.cpp +++ b/examples/widgets/touch/fingerpaint/mainwindow.cpp @@ -127,34 +127,34 @@ void MainWindow::createActions() { openAct = new QAction(tr("&Open..."), this); openAct->setShortcut(tr("Ctrl+O")); - connect(openAct, SIGNAL(triggered()), this, SLOT(open())); + connect(openAct, &QAction::triggered, this, &MainWindow::open); foreach (QByteArray format, QImageWriter::supportedImageFormats()) { QString text = tr("%1...").arg(QString(format).toUpper()); QAction *action = new QAction(text, this); action->setData(format); - connect(action, SIGNAL(triggered()), this, SLOT(save())); + connect(action, &QAction::triggered, this, &MainWindow::save); saveAsActs.append(action); } printAct = new QAction(tr("&Print..."), this); - connect(printAct, SIGNAL(triggered()), scribbleArea, SLOT(print())); + connect(printAct, &QAction::triggered, scribbleArea, &ScribbleArea::print); exitAct = new QAction(tr("E&xit"), this); exitAct->setShortcut(tr("Ctrl+Q")); - connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); + connect(exitAct, &QAction::triggered, this, &QWidget::close); clearScreenAct = new QAction(tr("&Clear Screen"), this); clearScreenAct->setShortcut(tr("Ctrl+L")); - connect(clearScreenAct, SIGNAL(triggered()), - scribbleArea, SLOT(clearImage())); + connect(clearScreenAct, &QAction::triggered, + scribbleArea, &ScribbleArea::clearImage); aboutAct = new QAction(tr("&About"), this); - connect(aboutAct, SIGNAL(triggered()), this, SLOT(about())); + connect(aboutAct, &QAction::triggered, this, &MainWindow::about); aboutQtAct = new QAction(tr("About &Qt"), this); - connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt())); + connect(aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt); } //! [14] |