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); registerField(QLatin1String("installation.components"), componentsList);
connect(componentsList, SIGNAL(itemChanged(QListWidgetItem *)), connect(componentsList, &ComponentListWidget::itemChanged,
this, SLOT(updateButton(QListWidgetItem *))); this, &ComponentSelectionPage::updateButton);
} }

@ -39,11 +39,11 @@ void Wizard::ExistingInstallationPage::initializePage()
} }
} }
connect(installationsList, SIGNAL(currentTextChanged(QString)), connect(installationsList, &QListWidget::currentTextChanged,
this, SLOT(textChanged(QString))); this, &ExistingInstallationPage::textChanged);
connect(installationsList,SIGNAL(itemSelectionChanged()), connect(installationsList, &QListWidget::itemSelectionChanged,
this, SIGNAL(completeChanged())); this, &ExistingInstallationPage::completeChanged);
} }
bool Wizard::ExistingInstallationPage::validatePage() 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 = std::make_unique<UnshieldWorker>(mGameSettings.value("morrowind-bsa-filesize").toLongLong());
mUnshield->moveToThread(mThread.get()); mUnshield->moveToThread(mThread.get());
connect(mThread.get(), SIGNAL(started()), connect(mThread.get(), &QThread::started,
mUnshield.get(), SLOT(extract())); mUnshield.get(), &UnshieldWorker::extract);
connect(mUnshield.get(), SIGNAL(finished()), connect(mUnshield.get(), &UnshieldWorker::finished,
mThread.get(), SLOT(quit())); mThread.get(), &QThread::quit);
connect(mUnshield.get(), SIGNAL(finished()), connect(mUnshield.get(), &UnshieldWorker::finished,
this, SLOT(installationFinished()), Qt::QueuedConnection); this, &InstallationPage::installationFinished, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(error(QString, QString)), connect(mUnshield.get(), &UnshieldWorker::error,
this, SLOT(installationError(QString, QString)), Qt::QueuedConnection); this, &InstallationPage::installationError, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(textChanged(QString)), connect(mUnshield.get(), &UnshieldWorker::textChanged,
installProgressLabel, SLOT(setText(QString)), Qt::QueuedConnection); installProgressLabel, &QLabel::setText, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(textChanged(QString)), connect(mUnshield.get(), &UnshieldWorker::textChanged,
logTextEdit, SLOT(appendPlainText(QString)), Qt::QueuedConnection); logTextEdit, &QPlainTextEdit::appendPlainText, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(textChanged(QString)), connect(mUnshield.get(), &UnshieldWorker::textChanged,
mWizard, SLOT(addLogText(QString)), Qt::QueuedConnection); mWizard, &MainWizard::addLogText, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(progressChanged(int)), connect(mUnshield.get(), &UnshieldWorker::progressChanged,
installProgressBar, SLOT(setValue(int)), Qt::QueuedConnection); installProgressBar, &QProgressBar::setValue, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(requestFileDialog(Wizard::Component)), connect(mUnshield.get(), &UnshieldWorker::requestFileDialog,
this, SLOT(showFileDialog(Wizard::Component)), Qt::QueuedConnection); this, &InstallationPage::showFileDialog, Qt::QueuedConnection);
connect(mUnshield.get(), SIGNAL(requestOldVersionDialog()), connect(mUnshield.get(), &UnshieldWorker::requestOldVersionDialog,
this, SLOT(showOldVersionDialog()) this, &InstallationPage::showOldVersionDialog, Qt::QueuedConnection);
, Qt::QueuedConnection);
} }
Wizard::InstallationPage::~InstallationPage() Wizard::InstallationPage::~InstallationPage()

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

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

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

Loading…
Cancel
Save