summaryrefslogtreecommitdiffstats
path: root/examples/widgets/tutorials/addressbook/part5
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-12-07 14:14:13 +0100
committerLuca Beldi <v.ronin@yahoo.it>2019-01-03 08:30:04 +0000
commita21f3431b861b09a4768801f856d431c6ac44313 (patch)
tree106324f1135965f8d984806a1c838a89708705bd /examples/widgets/tutorials/addressbook/part5
parent8c04aab8966611e96c64f469b7a1c6afe67e3fca (diff)
Cleanup Widgets examples - new signal/slot syntax
Cleanup the Widget examples - use the new signal/slot syntax where possible - tutorials subdirectory Change-Id: I741589f6616578412ad74f8371e0e3c87df783a2 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com> Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Diffstat (limited to 'examples/widgets/tutorials/addressbook/part5')
-rw-r--r--examples/widgets/tutorials/addressbook/part5/addressbook.cpp24
-rw-r--r--examples/widgets/tutorials/addressbook/part5/finddialog.cpp6
2 files changed, 20 insertions, 10 deletions
diff --git a/examples/widgets/tutorials/addressbook/part5/addressbook.cpp b/examples/widgets/tutorials/addressbook/part5/addressbook.cpp
index 6e09ec287d..5505a0e35c 100644
--- a/examples/widgets/tutorials/addressbook/part5/addressbook.cpp
+++ b/examples/widgets/tutorials/addressbook/part5/addressbook.cpp
@@ -86,16 +86,24 @@ AddressBook::AddressBook(QWidget *parent)
dialog = new FindDialog(this);
//! [instantiating FindDialog]
- connect(addButton, SIGNAL(clicked()), this, SLOT(addContact()));
- connect(submitButton, SIGNAL(clicked()), this, SLOT(submitContact()));
- connect(editButton, SIGNAL(clicked()), this, SLOT(editContact()));
- connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
- connect(removeButton, SIGNAL(clicked()), this, SLOT(removeContact()));
+ connect(addButton, &QPushButton::clicked,
+ this, &AddressBook::addContact);
+ connect(submitButton, &QPushButton::clicked,
+ this, &AddressBook::submitContact);
+ connect(editButton, &QPushButton::clicked,
+ this, &AddressBook::editContact);
+ connect(removeButton, &QPushButton::clicked,
+ this, &AddressBook::removeContact);
+ connect(cancelButton, &QPushButton::clicked,
+ this, &AddressBook::cancel);
//! [signals and slots for find]
- connect(findButton, SIGNAL(clicked()), this, SLOT(findContact()));
+ connect(findButton, &QPushButton::clicked,
+ this, &AddressBook::findContact);
//! [signals and slots for find]
- connect(nextButton, SIGNAL(clicked()), this, SLOT(next()));
- connect(previousButton, SIGNAL(clicked()), this, SLOT(previous()));
+ connect(nextButton, &QPushButton::clicked,
+ this, &AddressBook::next);
+ connect(previousButton, &QPushButton::clicked,
+ this, &AddressBook::previous);
QVBoxLayout *buttonLayout1 = new QVBoxLayout;
buttonLayout1->addWidget(addButton);
diff --git a/examples/widgets/tutorials/addressbook/part5/finddialog.cpp b/examples/widgets/tutorials/addressbook/part5/finddialog.cpp
index b0d9a5e6e3..615b39d42f 100644
--- a/examples/widgets/tutorials/addressbook/part5/finddialog.cpp
+++ b/examples/widgets/tutorials/addressbook/part5/finddialog.cpp
@@ -68,8 +68,10 @@ FindDialog::FindDialog(QWidget *parent)
setLayout(layout);
setWindowTitle(tr("Find a Contact"));
- connect(findButton, SIGNAL(clicked()), this, SLOT(findClicked()));
- connect(findButton, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(findButton, &QPushButton::clicked,
+ this, &FindDialog::findClicked);
+ connect(findButton, &QPushButton::clicked,
+ this, &FindDialog::accept);
}
//! [constructor]
//! [findClicked() function]