forked from qt-creator/qt-creator
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:
@@ -189,8 +189,7 @@ QWidget *AndroidBuildApkWidget::createApplicationGroup()
|
|||||||
targetSDKComboBox->addItems(targets);
|
targetSDKComboBox->addItems(targets);
|
||||||
targetSDKComboBox->setCurrentIndex(targets.indexOf(m_step->buildTargetSdk()));
|
targetSDKComboBox->setCurrentIndex(targets.indexOf(m_step->buildTargetSdk()));
|
||||||
|
|
||||||
const auto cbActivated = QOverload<int>::of(&QComboBox::activated);
|
connect(targetSDKComboBox, &QComboBox::activated, this, [this, targetSDKComboBox](int idx) {
|
||||||
connect(targetSDKComboBox, cbActivated, this, [this, targetSDKComboBox](int idx) {
|
|
||||||
const QString sdk = targetSDKComboBox->itemText(idx);
|
const QString sdk = targetSDKComboBox->itemText(idx);
|
||||||
m_step->setBuildTargetSdk(sdk);
|
m_step->setBuildTargetSdk(sdk);
|
||||||
AndroidManager::updateGradleProperties(m_step->target(), QString()); // FIXME: Use real key.
|
AndroidManager::updateGradleProperties(m_step->target(), QString()); // FIXME: Use real key.
|
||||||
@@ -292,11 +291,8 @@ QWidget *AndroidBuildApkWidget::createSignPackageGroup()
|
|||||||
m_step->setCertificateAlias(alias);
|
m_step->setCertificateAlias(alias);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto cbActivated = QOverload<int>::of(&QComboBox::activated);
|
connect(m_certificatesAliasComboBox, &QComboBox::activated, this, updateAlias);
|
||||||
const auto cbCurrentIndexChanged = QOverload<int>::of(&QComboBox::currentIndexChanged);
|
connect(m_certificatesAliasComboBox, &QComboBox::currentIndexChanged, this, updateAlias);
|
||||||
|
|
||||||
connect(m_certificatesAliasComboBox, cbActivated, this, updateAlias);
|
|
||||||
connect(m_certificatesAliasComboBox, cbCurrentIndexChanged, this, updateAlias);
|
|
||||||
|
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
@@ -1094,7 +1090,7 @@ PasswordInputDialog::PasswordInputDialog(PasswordInputDialog::Context context,
|
|||||||
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.isEmpty());
|
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.isEmpty());
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(buttonBox, &QDialogButtonBox::accepted, [this]() {
|
connect(buttonBox, &QDialogButtonBox::accepted, [this] {
|
||||||
if (verifyCallback(inputEdit->text())) {
|
if (verifyCallback(inputEdit->text())) {
|
||||||
accept(); // Dialog accepted.
|
accept(); // Dialog accepted.
|
||||||
} else {
|
} else {
|
||||||
|
@@ -685,7 +685,7 @@ void AndroidDeviceManager::setupDevicesWatcher()
|
|||||||
m_avdFileSystemWatcher.addPath(avdPath.toString());
|
m_avdFileSystemWatcher.addPath(avdPath.toString());
|
||||||
connect(&m_avdsFutureWatcher, &QFutureWatcherBase::finished,
|
connect(&m_avdsFutureWatcher, &QFutureWatcherBase::finished,
|
||||||
this, &AndroidDeviceManager::HandleAvdsListChange);
|
this, &AndroidDeviceManager::HandleAvdsListChange);
|
||||||
connect(&m_avdFileSystemWatcher, &QFileSystemWatcher::directoryChanged, this, [this]() {
|
connect(&m_avdFileSystemWatcher, &QFileSystemWatcher::directoryChanged, this, [this] {
|
||||||
// If the avd list upate command is running no need to call it again.
|
// If the avd list upate command is running no need to call it again.
|
||||||
if (!m_avdsFutureWatcher.isRunning())
|
if (!m_avdsFutureWatcher.isRunning())
|
||||||
updateAvdsList();
|
updateAvdsList();
|
||||||
|
@@ -766,8 +766,7 @@ QProcess *AndroidManager::runAdbCommandDetached(const QStringList &args, QString
|
|||||||
p->start(adb.toString(), args);
|
p->start(adb.toString(), args);
|
||||||
if (p->waitForStarted(500) && p->state() == QProcess::Running) {
|
if (p->waitForStarted(500) && p->state() == QProcess::Running) {
|
||||||
if (deleteOnFinish) {
|
if (deleteOnFinish) {
|
||||||
connect(p.get(), QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
connect(p.get(), &QProcess::finished, p.get(), &QObject::deleteLater);
|
||||||
p.get(), &QObject::deleteLater);
|
|
||||||
}
|
}
|
||||||
return p.release();
|
return p.release();
|
||||||
}
|
}
|
||||||
|
@@ -380,16 +380,11 @@ QGroupBox *AndroidManifestEditorWidget::createPackageFormLayout(QWidget *parent)
|
|||||||
|
|
||||||
connect(m_packageNameLineEdit, &QLineEdit::textEdited,
|
connect(m_packageNameLineEdit, &QLineEdit::textEdited,
|
||||||
this, &AndroidManifestEditorWidget::setPackageName);
|
this, &AndroidManifestEditorWidget::setPackageName);
|
||||||
connect(m_versionCodeLineEdit, &QLineEdit::textEdited,
|
connect(m_versionCodeLineEdit, &QLineEdit::textEdited, this, [this] { setDirty(); });
|
||||||
this, [this]() { setDirty(); });
|
connect(m_versionNameLinedit, &QLineEdit::textEdited, this, [this] { setDirty(); });
|
||||||
connect(m_versionNameLinedit, &QLineEdit::textEdited,
|
connect(m_androidMinSdkVersion, &QComboBox::currentIndexChanged, this, [this] { setDirty(); });
|
||||||
this, [this]() { setDirty(); });
|
connect(m_androidTargetSdkVersion, &QComboBox::currentIndexChanged,
|
||||||
connect(m_androidMinSdkVersion,
|
this, [this] { setDirty(); });
|
||||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
||||||
this, [this]() { setDirty(); });
|
|
||||||
connect(m_androidTargetSdkVersion,
|
|
||||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
||||||
this, [this]() { setDirty(); });
|
|
||||||
|
|
||||||
return packageGroupBox;
|
return packageGroupBox;
|
||||||
}
|
}
|
||||||
@@ -459,16 +454,10 @@ QGroupBox *Android::Internal::AndroidManifestEditorWidget::createApplicationGrou
|
|||||||
}
|
}
|
||||||
applicationGroupBox->setLayout(formLayout);
|
applicationGroupBox->setLayout(formLayout);
|
||||||
|
|
||||||
connect(m_appNameLineEdit, &QLineEdit::textEdited,
|
connect(m_appNameLineEdit, &QLineEdit::textEdited, this, [this] { setDirty(); });
|
||||||
this, [this]() { setDirty(); });
|
connect(m_activityNameLineEdit, &QLineEdit::textEdited, this, [this] { setDirty(); });
|
||||||
connect(m_activityNameLineEdit, &QLineEdit::textEdited,
|
connect(m_styleExtractMethod, &QComboBox::currentIndexChanged, this, [this] { setDirty(); });
|
||||||
this, [this]() { setDirty(); });
|
connect(m_screenOrientation, &QComboBox::currentIndexChanged, this, [this] { setDirty(); });
|
||||||
connect(m_styleExtractMethod,
|
|
||||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
||||||
this, [this]() { setDirty(); });
|
|
||||||
connect(m_screenOrientation,
|
|
||||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
||||||
this, [this]() { setDirty(); });
|
|
||||||
|
|
||||||
return applicationGroupBox;
|
return applicationGroupBox;
|
||||||
}
|
}
|
||||||
@@ -490,15 +479,15 @@ QGroupBox *AndroidManifestEditorWidget::createAdvancedGroupBox(QWidget *parent)
|
|||||||
m_textEditorWidget);
|
m_textEditorWidget);
|
||||||
m_advanvedTabWidget->addTab(m_splashButtons, tr("Splash screen"));
|
m_advanvedTabWidget->addTab(m_splashButtons, tr("Splash screen"));
|
||||||
|
|
||||||
connect(m_services, &AndroidServiceWidget::servicesModified, this, [this]() { setDirty(); });
|
connect(m_services, &AndroidServiceWidget::servicesModified, this, [this] { setDirty(); });
|
||||||
connect(m_services, &AndroidServiceWidget::servicesModified,
|
connect(m_services, &AndroidServiceWidget::servicesModified,
|
||||||
this, &AndroidManifestEditorWidget::clearInvalidServiceInfo);
|
this, &AndroidManifestEditorWidget::clearInvalidServiceInfo);
|
||||||
connect(m_services, &AndroidServiceWidget::servicesInvalid,
|
connect(m_services, &AndroidServiceWidget::servicesInvalid,
|
||||||
this, &AndroidManifestEditorWidget::setInvalidServiceInfo);
|
this, &AndroidManifestEditorWidget::setInvalidServiceInfo);
|
||||||
connect(m_splashButtons, &SplashScreenContainerWidget::splashScreensModified,
|
connect(m_splashButtons, &SplashScreenContainerWidget::splashScreensModified,
|
||||||
this, [this]() { setDirty(); });
|
this, [this] { setDirty(); });
|
||||||
connect(m_iconButtons, &AndroidManifestEditorIconContainerWidget::iconsModified,
|
connect(m_iconButtons, &AndroidManifestEditorIconContainerWidget::iconsModified,
|
||||||
this, [this]() { setDirty(); });
|
this, [this] { setDirty(); });
|
||||||
|
|
||||||
formLayout->addRow(m_advanvedTabWidget);
|
formLayout->addRow(m_advanvedTabWidget);
|
||||||
otherGroupBox->setLayout(formLayout);
|
otherGroupBox->setLayout(formLayout);
|
||||||
@@ -748,7 +737,7 @@ void AndroidManifestEditorWidget::updateInfoBar(const QString &errorMessage, int
|
|||||||
else
|
else
|
||||||
text = tr("%2: Could not parse file: \"%1\".").arg(errorMessage).arg(line);
|
text = tr("%2: Could not parse file: \"%1\".").arg(errorMessage).arg(line);
|
||||||
Utils::InfoBarEntry infoBarEntry(infoBarId, text);
|
Utils::InfoBarEntry infoBarEntry(infoBarId, text);
|
||||||
infoBarEntry.addCustomButton(tr("Goto error"), [this]() {
|
infoBarEntry.addCustomButton(tr("Goto error"), [this] {
|
||||||
m_textEditorWidget->gotoLine(m_errorLine, m_errorColumn);
|
m_textEditorWidget->gotoLine(m_errorLine, m_errorColumn);
|
||||||
});
|
});
|
||||||
infoBar->removeInfo(infoBarId);
|
infoBar->removeInfo(infoBarId);
|
||||||
|
@@ -199,7 +199,7 @@ void AndroidPlugin::askUserAboutAndroidSetup()
|
|||||||
info.addCustomButton(tr("Configure Android"), [this] {
|
info.addCustomButton(tr("Configure Android"), [this] {
|
||||||
Core::ICore::infoBar()->removeInfo(kSetupAndroidSetting);
|
Core::ICore::infoBar()->removeInfo(kSetupAndroidSetting);
|
||||||
Core::ICore::infoBar()->globallySuppressInfo(kSetupAndroidSetting);
|
Core::ICore::infoBar()->globallySuppressInfo(kSetupAndroidSetting);
|
||||||
QTimer::singleShot(0, this, [this]() { d->potentialKit.executeFromMenu(); });
|
QTimer::singleShot(0, this, [this] { d->potentialKit.executeFromMenu(); });
|
||||||
});
|
});
|
||||||
Core::ICore::infoBar()->addInfo(info);
|
Core::ICore::infoBar()->addInfo(info);
|
||||||
}
|
}
|
||||||
|
@@ -127,7 +127,7 @@ bool AndroidQmlPreviewWorker::isPreviewRunning(int lastKnownPid) const
|
|||||||
|
|
||||||
void AndroidQmlPreviewWorker::startPidWatcher()
|
void AndroidQmlPreviewWorker::startPidWatcher()
|
||||||
{
|
{
|
||||||
m_pidFutureWatcher.setFuture(runAsync([this]() {
|
m_pidFutureWatcher.setFuture(runAsync([this] {
|
||||||
// wait for started
|
// wait for started
|
||||||
const int sleepTimeMs = 2000;
|
const int sleepTimeMs = 2000;
|
||||||
QDeadlineTimer deadline(20000);
|
QDeadlineTimer deadline(20000);
|
||||||
|
@@ -774,7 +774,7 @@ void AndroidRunnerWorker::handleJdbWaiting()
|
|||||||
void AndroidRunnerWorker::handleJdbSettled()
|
void AndroidRunnerWorker::handleJdbSettled()
|
||||||
{
|
{
|
||||||
qCDebug(androidRunWorkerLog) << "Handle JDB settled";
|
qCDebug(androidRunWorkerLog) << "Handle JDB settled";
|
||||||
auto waitForCommand = [this]() {
|
auto waitForCommand = [this] {
|
||||||
for (int i= 0; i < 5 && m_jdbProcess->state() == QProcess::Running; ++i) {
|
for (int i= 0; i < 5 && m_jdbProcess->state() == QProcess::Running; ++i) {
|
||||||
m_jdbProcess->waitForReadyRead(500);
|
m_jdbProcess->waitForReadyRead(500);
|
||||||
QByteArray lines = m_jdbProcess->readAll();
|
QByteArray lines = m_jdbProcess->readAll();
|
||||||
@@ -858,7 +858,7 @@ void AndroidRunnerWorker::onProcessIdChanged(qint64 pid)
|
|||||||
QTC_ASSERT(m_psIsAlive, return);
|
QTC_ASSERT(m_psIsAlive, return);
|
||||||
m_psIsAlive->setObjectName("IsAliveProcess");
|
m_psIsAlive->setObjectName("IsAliveProcess");
|
||||||
m_psIsAlive->setProcessChannelMode(QProcess::MergedChannels);
|
m_psIsAlive->setProcessChannelMode(QProcess::MergedChannels);
|
||||||
connect(m_psIsAlive.get(), QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
connect(m_psIsAlive.get(), &QProcess::finished,
|
||||||
this, bind(&AndroidRunnerWorker::onProcessIdChanged, this, -1));
|
this, bind(&AndroidRunnerWorker::onProcessIdChanged, this, -1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -92,7 +92,7 @@ void AndroidSdkDownloader::downloadAndExtractSdk()
|
|||||||
|
|
||||||
connect(m_progressDialog, &QProgressDialog::canceled, this, &AndroidSdkDownloader::cancel);
|
connect(m_progressDialog, &QProgressDialog::canceled, this, &AndroidSdkDownloader::cancel);
|
||||||
|
|
||||||
connect(this, &AndroidSdkDownloader::sdkPackageWriteFinished, this, [this]() {
|
connect(this, &AndroidSdkDownloader::sdkPackageWriteFinished, this, [this] {
|
||||||
if (!Archive::supportsFile(m_sdkFilename))
|
if (!Archive::supportsFile(m_sdkFilename))
|
||||||
return;
|
return;
|
||||||
const FilePath extractDir = m_sdkFilename.parentDir();
|
const FilePath extractDir = m_sdkFilename.parentDir();
|
||||||
|
@@ -84,12 +84,12 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
|
|||||||
m_formatter = new Utils::OutputFormatter;
|
m_formatter = new Utils::OutputFormatter;
|
||||||
m_formatter->setPlainTextEdit(m_ui->outputEdit);
|
m_formatter->setPlainTextEdit(m_ui->outputEdit);
|
||||||
|
|
||||||
connect(m_sdkModel, &AndroidSdkModel::dataChanged, [this]() {
|
connect(m_sdkModel, &AndroidSdkModel::dataChanged, this, [this] {
|
||||||
if (m_ui->viewStack->currentWidget() == m_ui->packagesStack)
|
if (m_ui->viewStack->currentWidget() == m_ui->packagesStack)
|
||||||
m_ui->applySelectionButton->setEnabled(!m_sdkModel->userSelection().isEmpty());
|
m_ui->applySelectionButton->setEnabled(!m_sdkModel->userSelection().isEmpty());
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(m_sdkModel, &AndroidSdkModel::modelAboutToBeReset, [this]() {
|
connect(m_sdkModel, &AndroidSdkModel::modelAboutToBeReset, this, [this] {
|
||||||
m_ui->applySelectionButton->setEnabled(false);
|
m_ui->applySelectionButton->setEnabled(false);
|
||||||
m_ui->expandCheck->setChecked(false);
|
m_ui->expandCheck->setChecked(false);
|
||||||
cancelPendingOperations();
|
cancelPendingOperations();
|
||||||
@@ -102,7 +102,7 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
|
|||||||
m_ui->packagesView->header()->setSectionResizeMode(AndroidSdkModel::packageNameColumn,
|
m_ui->packagesView->header()->setSectionResizeMode(AndroidSdkModel::packageNameColumn,
|
||||||
QHeaderView::Stretch);
|
QHeaderView::Stretch);
|
||||||
m_ui->packagesView->header()->setStretchLastSection(false);
|
m_ui->packagesView->header()->setStretchLastSection(false);
|
||||||
connect(m_ui->expandCheck, &QCheckBox::stateChanged, [this](int state) {
|
connect(m_ui->expandCheck, &QCheckBox::stateChanged, this, [this](int state) {
|
||||||
if (state == Qt::Checked)
|
if (state == Qt::Checked)
|
||||||
m_ui->packagesView->expandAll();
|
m_ui->packagesView->expandAll();
|
||||||
else
|
else
|
||||||
@@ -110,19 +110,21 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
|
|||||||
});
|
});
|
||||||
connect(m_ui->updateInstalledButton, &QPushButton::clicked,
|
connect(m_ui->updateInstalledButton, &QPushButton::clicked,
|
||||||
this, &AndroidSdkManagerWidget::onUpdatePackages);
|
this, &AndroidSdkManagerWidget::onUpdatePackages);
|
||||||
connect(m_ui->showAllRadio, &QRadioButton::toggled, [this, proxyModel](bool checked) {
|
connect(m_ui->showAllRadio, &QRadioButton::toggled, this, [this, proxyModel](bool checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
proxyModel->setAcceptedPackageState(AndroidSdkPackage::AnyValidState);
|
proxyModel->setAcceptedPackageState(AndroidSdkPackage::AnyValidState);
|
||||||
m_sdkModel->resetSelection();
|
m_sdkModel->resetSelection();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(m_ui->showInstalledRadio, &QRadioButton::toggled, [this, proxyModel](bool checked) {
|
connect(m_ui->showInstalledRadio, &QRadioButton::toggled,
|
||||||
|
this, [this, proxyModel](bool checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
proxyModel->setAcceptedPackageState(AndroidSdkPackage::Installed);
|
proxyModel->setAcceptedPackageState(AndroidSdkPackage::Installed);
|
||||||
m_sdkModel->resetSelection();
|
m_sdkModel->resetSelection();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
connect(m_ui->showAvailableRadio, &QRadioButton::toggled, [this, proxyModel](bool checked) {
|
connect(m_ui->showAvailableRadio, &QRadioButton::toggled,
|
||||||
|
this, [this, proxyModel](bool checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
proxyModel->setAcceptedPackageState(AndroidSdkPackage::Available);
|
proxyModel->setAcceptedPackageState(AndroidSdkPackage::Available);
|
||||||
m_sdkModel->resetSelection();
|
m_sdkModel->resetSelection();
|
||||||
@@ -130,7 +132,8 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
|
|||||||
});
|
});
|
||||||
|
|
||||||
m_ui->searchField->setPlaceholderText("Filter");
|
m_ui->searchField->setPlaceholderText("Filter");
|
||||||
connect(m_ui->searchField, &QLineEdit::textChanged, [this, proxyModel](const QString &text) {
|
connect(m_ui->searchField, &QLineEdit::textChanged,
|
||||||
|
this, [this, proxyModel](const QString &text) {
|
||||||
proxyModel->setAcceptedSearchPackage(text);
|
proxyModel->setAcceptedSearchPackage(text);
|
||||||
m_sdkModel->resetSelection();
|
m_sdkModel->resetSelection();
|
||||||
// It is more convenient to expand the view with the results
|
// It is more convenient to expand the view with the results
|
||||||
@@ -138,22 +141,21 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
|
|||||||
});
|
});
|
||||||
|
|
||||||
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &AndroidSdkManagerWidget::close);
|
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &AndroidSdkManagerWidget::close);
|
||||||
connect(m_ui->applySelectionButton, &QPushButton::clicked,
|
connect(m_ui->applySelectionButton, &QPushButton::clicked, this, [this] { onApplyButton(); });
|
||||||
this, [this]() { onApplyButton(); });
|
|
||||||
connect(m_ui->cancelButton, &QPushButton::clicked, this,
|
connect(m_ui->cancelButton, &QPushButton::clicked, this,
|
||||||
&AndroidSdkManagerWidget::onCancel);
|
&AndroidSdkManagerWidget::onCancel);
|
||||||
connect(m_ui->optionsButton, &QPushButton::clicked,
|
connect(m_ui->optionsButton, &QPushButton::clicked,
|
||||||
this, &AndroidSdkManagerWidget::onSdkManagerOptions);
|
this, &AndroidSdkManagerWidget::onSdkManagerOptions);
|
||||||
connect(m_ui->sdkLicensebuttonBox, &QDialogButtonBox::accepted, [this]() {
|
connect(m_ui->sdkLicensebuttonBox, &QDialogButtonBox::accepted, this, [this] {
|
||||||
m_sdkManager->acceptSdkLicense(true);
|
m_sdkManager->acceptSdkLicense(true);
|
||||||
m_ui->sdkLicensebuttonBox->setEnabled(false); // Wait for next license to enable controls
|
m_ui->sdkLicensebuttonBox->setEnabled(false); // Wait for next license to enable controls
|
||||||
});
|
});
|
||||||
connect(m_ui->sdkLicensebuttonBox, &QDialogButtonBox::rejected, [this]() {
|
connect(m_ui->sdkLicensebuttonBox, &QDialogButtonBox::rejected, this, [this] {
|
||||||
m_sdkManager->acceptSdkLicense(false);
|
m_sdkManager->acceptSdkLicense(false);
|
||||||
m_ui->sdkLicensebuttonBox->setEnabled(false); // Wait for next license to enable controls
|
m_ui->sdkLicensebuttonBox->setEnabled(false); // Wait for next license to enable controls
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(m_ui->oboleteCheckBox, &QCheckBox::stateChanged, [this](int state) {
|
connect(m_ui->oboleteCheckBox, &QCheckBox::stateChanged, this, [this](int state) {
|
||||||
const QString obsoleteArg = "--include_obsolete";
|
const QString obsoleteArg = "--include_obsolete";
|
||||||
QStringList args = m_androidConfig.sdkManagerToolArgs();
|
QStringList args = m_androidConfig.sdkManagerToolArgs();
|
||||||
if (state == Qt::Checked && !args.contains(obsoleteArg)) {
|
if (state == Qt::Checked && !args.contains(obsoleteArg)) {
|
||||||
@@ -166,8 +168,7 @@ AndroidSdkManagerWidget::AndroidSdkManagerWidget(AndroidConfig &config,
|
|||||||
m_sdkManager->reloadPackages(true);
|
m_sdkManager->reloadPackages(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(m_ui->channelCheckbox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(m_ui->channelCheckbox, &QComboBox::currentIndexChanged, this, [this](int index) {
|
||||||
[this](int index) {
|
|
||||||
QStringList args = m_androidConfig.sdkManagerToolArgs();
|
QStringList args = m_androidConfig.sdkManagerToolArgs();
|
||||||
QString existingArg;
|
QString existingArg;
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
@@ -338,14 +339,12 @@ void AndroidSdkManagerWidget::addPackageFuture(const QFuture<AndroidSdkManager::
|
|||||||
QTC_ASSERT(!m_currentOperation, return);
|
QTC_ASSERT(!m_currentOperation, return);
|
||||||
if (!future.isFinished() || !future.isCanceled()) {
|
if (!future.isFinished() || !future.isCanceled()) {
|
||||||
m_currentOperation = new QFutureWatcher<AndroidSdkManager::OperationOutput>;
|
m_currentOperation = new QFutureWatcher<AndroidSdkManager::OperationOutput>;
|
||||||
connect(m_currentOperation,
|
connect(m_currentOperation, &QFutureWatcherBase::resultReadyAt,
|
||||||
&QFutureWatcher<AndroidSdkManager::OperationOutput>::resultReadyAt,
|
|
||||||
this, &AndroidSdkManagerWidget::onOperationResult);
|
this, &AndroidSdkManagerWidget::onOperationResult);
|
||||||
connect(m_currentOperation, &QFutureWatcher<AndroidSdkManager::OperationOutput>::finished,
|
connect(m_currentOperation, &QFutureWatcherBase::finished,
|
||||||
this, &AndroidSdkManagerWidget::packageFutureFinished);
|
this, &AndroidSdkManagerWidget::packageFutureFinished);
|
||||||
connect(m_currentOperation,
|
connect(m_currentOperation, &QFutureWatcherBase::progressValueChanged,
|
||||||
&QFutureWatcher<AndroidSdkManager::OperationOutput>::progressValueChanged,
|
this, [this](int value) {
|
||||||
[this](int value) {
|
|
||||||
m_ui->operationProgress->setValue(value);
|
m_ui->operationProgress->setValue(value);
|
||||||
});
|
});
|
||||||
m_currentOperation->setFuture(future);
|
m_currentOperation->setFuture(future);
|
||||||
|
@@ -49,11 +49,11 @@ AndroidSdkModel::AndroidSdkModel(const AndroidConfig &config, AndroidSdkManager
|
|||||||
m_sdkManager(sdkManager)
|
m_sdkManager(sdkManager)
|
||||||
{
|
{
|
||||||
QTC_CHECK(m_sdkManager);
|
QTC_CHECK(m_sdkManager);
|
||||||
connect(m_sdkManager, &AndroidSdkManager::packageReloadBegin, [this]() {
|
connect(m_sdkManager, &AndroidSdkManager::packageReloadBegin, [this] {
|
||||||
clearContainers();
|
clearContainers();
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
});
|
});
|
||||||
connect(m_sdkManager, &AndroidSdkManager::packageReloadFinished, [this]() {
|
connect(m_sdkManager, &AndroidSdkManager::packageReloadFinished, [this] {
|
||||||
refreshData();
|
refreshData();
|
||||||
endResetModel();
|
endResetModel();
|
||||||
});
|
});
|
||||||
|
@@ -405,12 +405,12 @@ AndroidSettingsWidget::AndroidSettingsWidget()
|
|||||||
this, &AndroidSettingsWidget::validateSdk);
|
this, &AndroidSettingsWidget::validateSdk);
|
||||||
connect(&m_sdkManager, &AndroidSdkManager::packageReloadFinished,
|
connect(&m_sdkManager, &AndroidSdkManager::packageReloadFinished,
|
||||||
m_androidProgress, &ProgressIndicator::hide);
|
m_androidProgress, &ProgressIndicator::hide);
|
||||||
connect(&m_sdkManager, &AndroidSdkManager::packageReloadBegin, this, [this]() {
|
connect(&m_sdkManager, &AndroidSdkManager::packageReloadBegin, this, [this] {
|
||||||
m_androidSummary->setInProgressText("Retrieving packages information");
|
m_androidSummary->setInProgressText("Retrieving packages information");
|
||||||
m_androidProgress->show();
|
m_androidProgress->show();
|
||||||
});
|
});
|
||||||
connect(m_ui.sdkManagerToolButton, &QAbstractButton::clicked,
|
connect(m_ui.sdkManagerToolButton, &QAbstractButton::clicked,
|
||||||
this, [this]() { m_sdkManagerWidget->exec(); });
|
this, [this] { m_sdkManagerWidget->exec(); });
|
||||||
connect(m_ui.sdkToolsAutoDownloadButton, &QAbstractButton::clicked,
|
connect(m_ui.sdkToolsAutoDownloadButton, &QAbstractButton::clicked,
|
||||||
this, &AndroidSettingsWidget::downloadSdk);
|
this, &AndroidSettingsWidget::downloadSdk);
|
||||||
connect(&m_sdkDownloader, &AndroidSdkDownloader::sdkDownloaderError, this, [this](const QString &error) {
|
connect(&m_sdkDownloader, &AndroidSdkDownloader::sdkDownloaderError, this, [this](const QString &error) {
|
||||||
|
@@ -60,11 +60,9 @@ AvdDialog::AvdDialog(const AndroidConfig &config, QWidget *parent)
|
|||||||
m_hideTipTimer.setSingleShot(true);
|
m_hideTipTimer.setSingleShot(true);
|
||||||
|
|
||||||
connect(&m_hideTipTimer, &QTimer::timeout, this, &Utils::ToolTip::hide);
|
connect(&m_hideTipTimer, &QTimer::timeout, this, &Utils::ToolTip::hide);
|
||||||
connect(m_avdDialog.deviceDefinitionTypeComboBox,
|
connect(m_avdDialog.deviceDefinitionTypeComboBox, &QComboBox::currentIndexChanged,
|
||||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
||||||
this, &AvdDialog::updateDeviceDefinitionComboBox);
|
this, &AvdDialog::updateDeviceDefinitionComboBox);
|
||||||
connect(m_avdDialog.abiComboBox,
|
connect(m_avdDialog.abiComboBox, &QComboBox::currentIndexChanged,
|
||||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
|
||||||
this, &AvdDialog::updateApiLevelComboBox);
|
this, &AvdDialog::updateApiLevelComboBox);
|
||||||
|
|
||||||
deviceTypeToStringMap.insert(AvdDialog::Phone, "Phone");
|
deviceTypeToStringMap.insert(AvdDialog::Phone, "Phone");
|
||||||
|
@@ -119,8 +119,7 @@ ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard)
|
|||||||
}
|
}
|
||||||
|
|
||||||
nodeSelected(m_comboBox->currentIndex());
|
nodeSelected(m_comboBox->currentIndex());
|
||||||
connect(m_comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(m_comboBox, &QComboBox::currentIndexChanged, this, &ChooseProFilePage::nodeSelected);
|
||||||
this, &ChooseProFilePage::nodeSelected);
|
|
||||||
|
|
||||||
fl->addRow(tr(".pro file:"), m_comboBox);
|
fl->addRow(tr(".pro file:"), m_comboBox);
|
||||||
setTitle(tr("Select a .pro File"));
|
setTitle(tr("Select a .pro File"));
|
||||||
|
@@ -45,17 +45,16 @@ CreateSimulatorDialog::CreateSimulatorDialog(QWidget *parent)
|
|||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
|
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->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
|
||||||
!m_ui->nameEdit->text().isEmpty() &&
|
!m_ui->nameEdit->text().isEmpty() &&
|
||||||
m_ui->deviceTypeCombo->currentIndex() > 0 &&
|
m_ui->deviceTypeCombo->currentIndex() > 0 &&
|
||||||
m_ui->runtimeCombo->currentIndex() > 0);
|
m_ui->runtimeCombo->currentIndex() > 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto indexChanged = QOverload<int>::of(&QComboBox::currentIndexChanged);
|
connect(m_ui->nameEdit, &QLineEdit::textChanged, this, enableOk);
|
||||||
connect(m_ui->nameEdit, &QLineEdit::textChanged, enableOk);
|
connect(m_ui->runtimeCombo, &QComboBox::currentIndexChanged, this, enableOk);
|
||||||
connect(m_ui->runtimeCombo, indexChanged, enableOk);
|
connect(m_ui->deviceTypeCombo, &QComboBox::currentIndexChanged, this, [this, enableOk] {
|
||||||
connect(m_ui->deviceTypeCombo, indexChanged, [this, enableOk]() {
|
|
||||||
populateRuntimes(m_ui->deviceTypeCombo->currentData().value<DeviceTypeInfo>());
|
populateRuntimes(m_ui->deviceTypeCombo->currentData().value<DeviceTypeInfo>());
|
||||||
enableOk();
|
enableOk();
|
||||||
});
|
});
|
||||||
|
@@ -155,18 +155,12 @@ IosSigningSettingsWidget::IosSigningSettingsWidget(BuildConfiguration *buildConf
|
|||||||
detailsWidget->setWidget(container);
|
detailsWidget->setWidget(container);
|
||||||
|
|
||||||
if (m_isDevice) {
|
if (m_isDevice) {
|
||||||
connect(IosConfigurations::instance(),
|
connect(IosConfigurations::instance(), &IosConfigurations::provisioningDataChanged,
|
||||||
&IosConfigurations::provisioningDataChanged,
|
this, &IosSigningSettingsWidget::populateDevelopmentTeams);
|
||||||
this,
|
connect(m_signEntityCombo, &QComboBox::currentIndexChanged,
|
||||||
&IosSigningSettingsWidget::populateDevelopmentTeams);
|
this, &IosSigningSettingsWidget::onSigningEntityComboIndexChanged);
|
||||||
connect(m_signEntityCombo,
|
connect(m_autoSignCheckbox, &QCheckBox::toggled,
|
||||||
QOverload<int>::of(&QComboBox::currentIndexChanged),
|
this, &IosSigningSettingsWidget::configureSigningUi);
|
||||||
this,
|
|
||||||
&IosSigningSettingsWidget::onSigningEntityComboIndexChanged);
|
|
||||||
connect(m_autoSignCheckbox,
|
|
||||||
&QCheckBox::toggled,
|
|
||||||
this,
|
|
||||||
&IosSigningSettingsWidget::configureSigningUi);
|
|
||||||
const QString signingIdentifier = m_signingIdentifier->value();
|
const QString signingIdentifier = m_signingIdentifier->value();
|
||||||
configureSigningUi(m_autoSignCheckbox->isChecked());
|
configureSigningUi(m_autoSignCheckbox->isChecked());
|
||||||
setDefaultSigningIdentfier(signingIdentifier);
|
setDefaultSigningIdentfier(signingIdentifier);
|
||||||
|
@@ -357,7 +357,7 @@ void IosDeviceTypeAspect::addToLayout(LayoutBuilder &builder)
|
|||||||
|
|
||||||
updateValues();
|
updateValues();
|
||||||
|
|
||||||
connect(m_deviceTypeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(m_deviceTypeComboBox, &QComboBox::currentIndexChanged,
|
||||||
this, &IosDeviceTypeAspect::setDeviceTypeIndex);
|
this, &IosDeviceTypeAspect::setDeviceTypeIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -675,7 +675,7 @@ IosDeviceToolHandlerPrivate::IosDeviceToolHandlerPrivate(const IosDeviceType &de
|
|||||||
QObject::connect(process.get(), &QProcess::readyReadStandardOutput,
|
QObject::connect(process.get(), &QProcess::readyReadStandardOutput,
|
||||||
std::bind(&IosDeviceToolHandlerPrivate::subprocessHasData,this));
|
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));
|
std::bind(&IosDeviceToolHandlerPrivate::subprocessFinished,this, _1,_2));
|
||||||
|
|
||||||
QObject::connect(process.get(), &QProcess::errorOccurred,
|
QObject::connect(process.get(), &QProcess::errorOccurred,
|
||||||
|
@@ -101,11 +101,10 @@ void WebBrowserSelectionAspect::addToLayout(LayoutBuilder &builder)
|
|||||||
for (const WebBrowserEntry &be : m_availableBrowsers)
|
for (const WebBrowserEntry &be : m_availableBrowsers)
|
||||||
m_webBrowserComboBox->addItem(be.second, be.first);
|
m_webBrowserComboBox->addItem(be.second, be.first);
|
||||||
m_webBrowserComboBox->setCurrentIndex(m_webBrowserComboBox->findData(m_currentBrowser));
|
m_webBrowserComboBox->setCurrentIndex(m_webBrowserComboBox->findData(m_currentBrowser));
|
||||||
connect(m_webBrowserComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
connect(m_webBrowserComboBox, &QComboBox::currentIndexChanged, this, [this] {
|
||||||
[this]() {
|
m_currentBrowser = m_webBrowserComboBox->currentData().toString();
|
||||||
m_currentBrowser = m_webBrowserComboBox->currentData().toString();
|
emit changed();
|
||||||
emit changed();
|
});
|
||||||
});
|
|
||||||
builder.addItems({tr("Web browser:"), m_webBrowserComboBox});
|
builder.addItems({tr("Web browser:"), m_webBrowserComboBox});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user