functor-based Qt signal-slot syntax wizard

crashfix_debugdraw
Mat 2 years ago committed by mpeco
parent a5a0d26976
commit 405a5c5d25

@ -18,8 +18,8 @@ Wizard::ComponentSelectionPage::ComponentSelectionPage(QWidget *parent) :
registerField(QLatin1String("installation.components"), componentsList);
connect(componentsList, SIGNAL(itemChanged(QListWidgetItem *)),
this, SLOT(updateButton(QListWidgetItem *)));
connect(componentsList, &ComponentListWidget::itemChanged,
this, &ComponentSelectionPage::updateButton);
}

@ -39,11 +39,11 @@ void Wizard::ExistingInstallationPage::initializePage()
}
}
connect(installationsList, SIGNAL(currentTextChanged(QString)),
this, SLOT(textChanged(QString)));
connect(installationsList, &QListWidget::currentTextChanged,
this, &ExistingInstallationPage::textChanged);
connect(installationsList,SIGNAL(itemSelectionChanged()),
this, SIGNAL(completeChanged()));
connect(installationsList, &QListWidget::itemSelectionChanged,
this, &ExistingInstallationPage::completeChanged);
}
bool Wizard::ExistingInstallationPage::validatePage()

@ -21,36 +21,35 @@ Wizard::InstallationPage::InstallationPage(QWidget *parent, Config::GameSettings
mUnshield = std::make_unique<UnshieldWorker>(mGameSettings.value("morrowind-bsa-filesize").toLongLong());
mUnshield->moveToThread(mThread.get());
connect(mThread.get(), SIGNAL(started()),
mUnshield.get(), SLOT(extract()));
connect(mThread.get(), &QThread::started,
mUnshield.get(), &UnshieldWorker::extract);
connect(mUnshield.get(), SIGNAL(finished()),
mThread.get(), SLOT(quit()));
connect(mUnshield.get(), &UnshieldWorker::finished,
mThread.get(), &QThread::quit);
connect(mUnshield.get(), SIGNAL(finished()),
this, SLOT(installationFinished()), Qt::QueuedConnection);
connect(mUnshield.get(), &UnshieldWorker::finished,
this, &InstallationPage::installationFinished, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(error(QString, QString)),
this, SLOT(installationError(QString, QString)), Qt::QueuedConnection);
connect(mUnshield.get(), &UnshieldWorker::error,
this, &InstallationPage::installationError, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(textChanged(QString)),
installProgressLabel, SLOT(setText(QString)), Qt::QueuedConnection);
connect(mUnshield.get(), &UnshieldWorker::textChanged,
installProgressLabel, &QLabel::setText, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(textChanged(QString)),
logTextEdit, SLOT(appendPlainText(QString)), Qt::QueuedConnection);
connect(mUnshield.get(), &UnshieldWorker::textChanged,
logTextEdit, &QPlainTextEdit::appendPlainText, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(textChanged(QString)),
mWizard, SLOT(addLogText(QString)), Qt::QueuedConnection);
connect(mUnshield.get(), &UnshieldWorker::textChanged,
mWizard, &MainWizard::addLogText, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(progressChanged(int)),
installProgressBar, SLOT(setValue(int)), Qt::QueuedConnection);
connect(mUnshield.get(), &UnshieldWorker::progressChanged,
installProgressBar, &QProgressBar::setValue, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(requestFileDialog(Wizard::Component)),
this, SLOT(showFileDialog(Wizard::Component)), Qt::QueuedConnection);
connect(mUnshield.get(), &UnshieldWorker::requestFileDialog,
this, &InstallationPage::showFileDialog, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(requestOldVersionDialog()),
this, SLOT(showOldVersionDialog())
, Qt::QueuedConnection);
connect(mUnshield.get(), &UnshieldWorker::requestOldVersionDialog,
this, &InstallationPage::showOldVersionDialog, Qt::QueuedConnection);
}
Wizard::InstallationPage::~InstallationPage()

@ -44,11 +44,11 @@ Wizard::MainWizard::MainWizard(QWidget *parent) :
mImporterInvoker = new ProcessInvoker();
connect(mImporterInvoker->getProcess(), SIGNAL(started()),
this, SLOT(importerStarted()));
connect(mImporterInvoker->getProcess(), &QProcess::started,
this, &MainWizard::importerStarted);
connect(mImporterInvoker->getProcess(), SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(importerFinished(int,QProcess::ExitStatus)));
connect(mImporterInvoker->getProcess(), qOverload<int, QProcess::ExitStatus>(&QProcess::finished),
this, &MainWizard::importerFinished);
mLogError = tr("<html><head/><body><p><b>Could not open %1 for writing</b></p> \
<p>Please make sure you have the right permissions \

@ -19,7 +19,7 @@ Wizard::MethodSelectionPage::MethodSelectionPage(QWidget *parent) :
registerField(QLatin1String("installation.retailDisc"), retailDiscRadioButton);
connect(buyLinkButton, SIGNAL(released()), this, SLOT(handleBuyButton()));
connect(buyLinkButton, &QCommandLinkButton::released, this, &MethodSelectionPage::handleBuyButton);
}
int Wizard::MethodSelectionPage::nextId() const

@ -7,11 +7,11 @@ ComponentListWidget::ComponentListWidget(QWidget *parent) :
{
mCheckedItems = QStringList();
connect(this, SIGNAL(itemChanged(QListWidgetItem *)),
this, SLOT(updateCheckedItems(QListWidgetItem *)));
connect(this, &ComponentListWidget::itemChanged,
this, qOverload<QListWidgetItem*>(&ComponentListWidget::updateCheckedItems));
connect(model(), SIGNAL(rowsInserted(QModelIndex, int, int)),
this, SLOT(updateCheckedItems(QModelIndex, int, int)));
connect(model(), &QAbstractItemModel::rowsInserted,
this, qOverload<const QModelIndex &, int, int>(&ComponentListWidget::updateCheckedItems));
}
QStringList ComponentListWidget::checkedItems()

Loading…
Cancel
Save