Drop Qt5: Android, IOS & WASM: Get rid of QOverload

Add a context object into some lambdas.

Change-Id: I72631aeb36703f8f335f3819796fb52148f1b377
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-07-19 22:51:32 +02:00
parent 0dae822ca3
commit a98b185e90
18 changed files with 66 additions and 94 deletions

View File

@@ -45,17 +45,16 @@ CreateSimulatorDialog::CreateSimulatorDialog(QWidget *parent)
m_ui->setupUi(this);
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
const auto enableOk = [this]() {
const auto enableOk = [this] {
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
!m_ui->nameEdit->text().isEmpty() &&
m_ui->deviceTypeCombo->currentIndex() > 0 &&
m_ui->runtimeCombo->currentIndex() > 0);
};
const auto indexChanged = QOverload<int>::of(&QComboBox::currentIndexChanged);
connect(m_ui->nameEdit, &QLineEdit::textChanged, enableOk);
connect(m_ui->runtimeCombo, indexChanged, enableOk);
connect(m_ui->deviceTypeCombo, indexChanged, [this, enableOk]() {
connect(m_ui->nameEdit, &QLineEdit::textChanged, this, enableOk);
connect(m_ui->runtimeCombo, &QComboBox::currentIndexChanged, this, enableOk);
connect(m_ui->deviceTypeCombo, &QComboBox::currentIndexChanged, this, [this, enableOk] {
populateRuntimes(m_ui->deviceTypeCombo->currentData().value<DeviceTypeInfo>());
enableOk();
});

View File

@@ -155,18 +155,12 @@ IosSigningSettingsWidget::IosSigningSettingsWidget(BuildConfiguration *buildConf
detailsWidget->setWidget(container);
if (m_isDevice) {
connect(IosConfigurations::instance(),
&IosConfigurations::provisioningDataChanged,
this,
&IosSigningSettingsWidget::populateDevelopmentTeams);
connect(m_signEntityCombo,
QOverload<int>::of(&QComboBox::currentIndexChanged),
this,
&IosSigningSettingsWidget::onSigningEntityComboIndexChanged);
connect(m_autoSignCheckbox,
&QCheckBox::toggled,
this,
&IosSigningSettingsWidget::configureSigningUi);
connect(IosConfigurations::instance(), &IosConfigurations::provisioningDataChanged,
this, &IosSigningSettingsWidget::populateDevelopmentTeams);
connect(m_signEntityCombo, &QComboBox::currentIndexChanged,
this, &IosSigningSettingsWidget::onSigningEntityComboIndexChanged);
connect(m_autoSignCheckbox, &QCheckBox::toggled,
this, &IosSigningSettingsWidget::configureSigningUi);
const QString signingIdentifier = m_signingIdentifier->value();
configureSigningUi(m_autoSignCheckbox->isChecked());
setDefaultSigningIdentfier(signingIdentifier);

View File

@@ -357,7 +357,7 @@ void IosDeviceTypeAspect::addToLayout(LayoutBuilder &builder)
updateValues();
connect(m_deviceTypeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
connect(m_deviceTypeComboBox, &QComboBox::currentIndexChanged,
this, &IosDeviceTypeAspect::setDeviceTypeIndex);
}

View File

@@ -675,7 +675,7 @@ IosDeviceToolHandlerPrivate::IosDeviceToolHandlerPrivate(const IosDeviceType &de
QObject::connect(process.get(), &QProcess::readyReadStandardOutput,
std::bind(&IosDeviceToolHandlerPrivate::subprocessHasData,this));
QObject::connect(process.get(), QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
QObject::connect(process.get(), &QProcess::finished,
std::bind(&IosDeviceToolHandlerPrivate::subprocessFinished,this, _1,_2));
QObject::connect(process.get(), &QProcess::errorOccurred,