summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tools/completer/mainwindow.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-12-07 14:17:38 +0100
committerLuca Beldi <v.ronin@yahoo.it>2019-01-03 08:29:56 +0000
commit8c04aab8966611e96c64f469b7a1c6afe67e3fca (patch)
tree40fe2bc3f4d945a65828d49586292ea6c72440a1 /examples/widgets/tools/completer/mainwindow.cpp
parent451ebdff824cad329b40aad9a10cec5e5cb464cc (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/tools/completer/mainwindow.cpp')
-rw-r--r--examples/widgets/tools/completer/mainwindow.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/examples/widgets/tools/completer/mainwindow.cpp b/examples/widgets/tools/completer/mainwindow.cpp
index 8eb2e60030..114ff0fd7c 100644
--- a/examples/widgets/tools/completer/mainwindow.cpp
+++ b/examples/widgets/tools/completer/mainwindow.cpp
@@ -102,10 +102,14 @@ MainWindow::MainWindow(QWidget *parent)
contentsLabel = new QLabel;
contentsLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- connect(modelCombo, SIGNAL(activated(int)), this, SLOT(changeModel()));
- connect(modeCombo, SIGNAL(activated(int)), this, SLOT(changeMode(int)));
- connect(caseCombo, SIGNAL(activated(int)), this, SLOT(changeCase(int)));
- connect(maxVisibleSpinBox, SIGNAL(valueChanged(int)), this, SLOT(changeMaxVisible(int)));
+ connect(modelCombo, QOverload<int>::of(&QComboBox::activated),
+ this, &MainWindow::changeModel);
+ connect(modeCombo, QOverload<int>::of(&QComboBox::activated),
+ this, &MainWindow::changeMode);
+ connect(caseCombo, QOverload<int>::of(&QComboBox::activated),
+ this, &MainWindow::changeCase);
+ connect(maxVisibleSpinBox, QOverload<int>::of(&QSpinBox::valueChanged),
+ this, &MainWindow::changeMaxVisible);
//! [2]
//! [3]
@@ -136,9 +140,9 @@ void MainWindow::createMenu()
QAction *aboutAct = new QAction(tr("About"), this);
QAction *aboutQtAct = new QAction(tr("About Qt"), this);
- connect(exitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
- connect(aboutAct, SIGNAL(triggered()), this, SLOT(about()));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
+ connect(exitAction, &QAction::triggered, qApp, &QApplication::quit);
+ connect(aboutAct, &QAction::triggered, this, &MainWindow::about);
+ connect(aboutQtAct, &QAction::triggered, qApp, &QApplication::aboutQt);
QMenu* fileMenu = menuBar()->addMenu(tr("File"));
fileMenu->addAction(exitAction);
@@ -271,7 +275,7 @@ void MainWindow::changeModel()
changeCase(caseCombo->currentIndex());
completer->setWrapAround(wrapCheckBox->isChecked());
lineEdit->setCompleter(completer);
- connect(wrapCheckBox, SIGNAL(clicked(bool)), completer, SLOT(setWrapAround(bool)));
+ connect(wrapCheckBox, &QAbstractButton::clicked, completer, &QCompleter::setWrapAround);
}
//! [14]