From a55b7eb7a765f09f0e83e9d3ce5696f540b6bd9b Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 24 Mar 2017 18:18:49 +0100 Subject: Change to new style connect syntax Quite some code churn, but I like the idea that wrong connections are compile time errors. Since I had to get rid of default arguments in Slots, this simplified things in doPopulateByFolder... --- configurationdialog.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'configurationdialog.cpp') diff --git a/configurationdialog.cpp b/configurationdialog.cpp index 1d3b605..58e33e8 100644 --- a/configurationdialog.cpp +++ b/configurationdialog.cpp @@ -33,9 +33,9 @@ ConfigurationDialog::ConfigurationDialog(QWidget *parent, Qt::WindowFlags f) : Q //buttons QPushButton *acceptB = new QPushButton(tr("Save")); - connect(acceptB, SIGNAL(clicked()), this, SLOT(accept())); + connect(acceptB, &QPushButton::clicked, this, &ConfigurationDialog::accept); QPushButton *cancelB = new QPushButton(tr("Cancel")); - connect(cancelB, SIGNAL(clicked()), this, SLOT(reject())); + connect(cancelB, &QPushButton::clicked, this, &ConfigurationDialog::reject); QHBoxLayout *bLayout = new QHBoxLayout; bLayout->addStretch(); bLayout->addWidget(acceptB); @@ -71,9 +71,9 @@ ConfigurationDialog::ConfigurationDialog(QWidget *parent, Qt::WindowFlags f) : Q QSignalMapper *colorMapper = new QSignalMapper(this); colorMapper->setMapping(baseColorB, mBaseColorL); colorMapper->setMapping(altColorB, mAltColorL); - connect(baseColorB, SIGNAL(clicked()), colorMapper, SLOT(map())); - connect(altColorB, SIGNAL(clicked()), colorMapper, SLOT(map())); - connect(colorMapper, SIGNAL(mapped(QWidget*)), this, SLOT(chooseColor(QWidget*))); + connect(baseColorB, &QPushButton::clicked, colorMapper, static_cast(&QSignalMapper::map)); + connect(altColorB, &QPushButton::clicked, colorMapper, static_cast(&QSignalMapper::map)); + connect(colorMapper, static_cast(&QSignalMapper::mapped), this, &ConfigurationDialog::chooseColor); //dialog layout QVBoxLayout *mainLayout = new QVBoxLayout; -- cgit v1.2.3-70-g09d2