From 60a5f77ef220c1f1f6f5e1387f289b77ab908122 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 19 Jul 2022 22:57:37 +0200 Subject: [PATCH] Drop Qt5: VCS: Get rid of QComboBox QOverload Change-Id: Ib2f21f28a0ec16b817f9227c6234424001752d50 Reviewed-by: Orgad Shaneh --- src/plugins/clearcase/activityselector.cpp | 7 +++---- src/plugins/git/gerrit/gerritpushdialog.cpp | 4 ++-- src/plugins/gitlab/gitlabdialog.cpp | 2 +- src/plugins/gitlab/gitlaboptionspage.cpp | 3 +-- src/plugins/gitlab/gitlabprojectsettings.cpp | 10 ++++------ src/plugins/vcsbase/submitfieldwidget.cpp | 2 +- src/plugins/vcsbase/vcsbaseeditor.cpp | 4 ++-- src/plugins/vcsbase/vcsbaseeditorconfig.cpp | 3 +-- 8 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/plugins/clearcase/activityselector.cpp b/src/plugins/clearcase/activityselector.cpp index 952b9278d44..af19453e6d7 100644 --- a/src/plugins/clearcase/activityselector.cpp +++ b/src/plugins/clearcase/activityselector.cpp @@ -65,8 +65,7 @@ ActivitySelector::ActivitySelector(QWidget *parent) : QWidget(parent) connect(btnAdd, &QToolButton::clicked, this, &ActivitySelector::newActivity); refresh(); - connect(m_cmbActivity, QOverload::of(&QComboBox::currentIndexChanged), - this, &ActivitySelector::userChanged); + connect(m_cmbActivity, &QComboBox::currentIndexChanged, this, &ActivitySelector::userChanged); } void ActivitySelector::userChanged() @@ -102,10 +101,10 @@ void ActivitySelector::setActivity(const QString &act) { int index = m_cmbActivity->findData(act); if (index != -1) { - disconnect(m_cmbActivity, QOverload::of(&QComboBox::currentIndexChanged), + disconnect(m_cmbActivity, &QComboBox::currentIndexChanged, this, &ActivitySelector::userChanged); m_cmbActivity->setCurrentIndex(index); - connect(m_cmbActivity, QOverload::of(&QComboBox::currentIndexChanged), + connect(m_cmbActivity, &QComboBox::currentIndexChanged, this, &ActivitySelector::userChanged); } } diff --git a/src/plugins/git/gerrit/gerritpushdialog.cpp b/src/plugins/git/gerrit/gerritpushdialog.cpp index 1a929cbf8fc..715ee2a4902 100644 --- a/src/plugins/git/gerrit/gerritpushdialog.cpp +++ b/src/plugins/git/gerrit/gerritpushdialog.cpp @@ -147,10 +147,10 @@ GerritPushDialog::GerritPushDialog(const Utils::FilePath &workingDir, const QStr } m_ui->localBranchComboBox->init(workingDir); - connect(m_ui->localBranchComboBox, QOverload::of(&QComboBox::currentIndexChanged), + connect(m_ui->localBranchComboBox, &QComboBox::currentIndexChanged, this, &GerritPushDialog::updateCommits); - connect(m_ui->targetBranchComboBox, QOverload::of(&QComboBox::currentIndexChanged), + connect(m_ui->targetBranchComboBox, &QComboBox::currentIndexChanged, this, &GerritPushDialog::setChangeRange); connect(m_ui->targetBranchComboBox, &QComboBox::currentTextChanged, diff --git a/src/plugins/gitlab/gitlabdialog.cpp b/src/plugins/gitlab/gitlabdialog.cpp index 6b16c1fdc10..30b2e6596dd 100644 --- a/src/plugins/gitlab/gitlabdialog.cpp +++ b/src/plugins/gitlab/gitlabdialog.cpp @@ -57,7 +57,7 @@ GitLabDialog::GitLabDialog(QWidget *parent) updateRemotes(); - connect(m_ui.remoteCB, QOverload::of(&QComboBox::currentIndexChanged), + connect(m_ui.remoteCB, &QComboBox::currentIndexChanged, this, &GitLabDialog::requestMainViewUpdate); connect(m_ui.searchLE, &QLineEdit::returnPressed, this, &GitLabDialog::querySearch); connect(m_ui.searchPB, &QPushButton::clicked, this, &GitLabDialog::querySearch); diff --git a/src/plugins/gitlab/gitlaboptionspage.cpp b/src/plugins/gitlab/gitlaboptionspage.cpp index 6df8373402f..4f5f20b2ec8 100644 --- a/src/plugins/gitlab/gitlaboptionspage.cpp +++ b/src/plugins/gitlab/gitlaboptionspage.cpp @@ -156,8 +156,7 @@ GitLabOptionsWidget::GitLabOptionsWidget(QWidget *parent) connect(m_edit, &QPushButton::clicked, this, &GitLabOptionsWidget::showEditServerDialog); connect(m_remove, &QPushButton::clicked, this, &GitLabOptionsWidget::removeCurrentTriggered); connect(m_add, &QPushButton::clicked, this, &GitLabOptionsWidget::showAddServerDialog); - connect(m_defaultGitLabServer, QOverload::of(&QComboBox::currentIndexChanged), - this, [this]() { + connect(m_defaultGitLabServer, &QComboBox::currentIndexChanged, this, [this] { m_gitLabServerWidget->setGitLabServer( m_defaultGitLabServer->currentData().value()); }); diff --git a/src/plugins/gitlab/gitlabprojectsettings.cpp b/src/plugins/gitlab/gitlabprojectsettings.cpp index 35419ca6679..29b23381d73 100644 --- a/src/plugins/gitlab/gitlabprojectsettings.cpp +++ b/src/plugins/gitlab/gitlabprojectsettings.cpp @@ -163,20 +163,18 @@ GitLabProjectSettingsWidget::GitLabProjectSettingsWidget(ProjectExplorer::Projec verticalLayout->addWidget(new QLabel(tr("Projects linked with GitLab receive event " "notifications in the Version Control output pane."))); - connect(m_linkWithGitLab, &QPushButton::clicked, this, [this]() { + connect(m_linkWithGitLab, &QPushButton::clicked, this, [this] { checkConnection(Link); }); connect(m_unlink, &QPushButton::clicked, this, &GitLabProjectSettingsWidget::unlink); - connect(m_checkConnection, &QPushButton::clicked, this, [this]() { + connect(m_checkConnection, &QPushButton::clicked, this, [this] { checkConnection(Connection); }); - connect(m_linkedGitLabServer, QOverload::of(&QComboBox::currentIndexChanged), - this, [this]() { + connect(m_linkedGitLabServer, &QComboBox::currentIndexChanged, this, [this] { m_infoLabel->setVisible(false); }); - connect(m_hostCB, QOverload::of(&QComboBox::currentIndexChanged), - this, [this]() { + connect(m_hostCB, &QComboBox::currentIndexChanged, this, [this] { m_infoLabel->setVisible(false); }); connect(GitLabPlugin::optionsPage(), &GitLabOptionsPage::settingsChanged, diff --git a/src/plugins/vcsbase/submitfieldwidget.cpp b/src/plugins/vcsbase/submitfieldwidget.cpp index 46978f3519e..7034858b81b 100644 --- a/src/plugins/vcsbase/submitfieldwidget.cpp +++ b/src/plugins/vcsbase/submitfieldwidget.cpp @@ -286,7 +286,7 @@ void SubmitFieldWidget::createField(const QString &f) if (d->completer) fe.lineEdit->setCompleter(d->completer); - connect(fe.combo, QOverload::of(&QComboBox::currentIndexChanged), + connect(fe.combo, &QComboBox::currentIndexChanged, this, &SubmitFieldWidget::slotComboIndexChanged); connect(fe.clearButton, &QAbstractButton::clicked, this, &SubmitFieldWidget::slotRemove); diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 92d2f967fac..14fb533e19f 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -740,7 +740,7 @@ void VcsBaseEditorWidget::init() case OtherContent: break; case LogOutput: - connect(d->entriesComboBox(), QOverload::of(&QComboBox::activated), + connect(d->entriesComboBox(), &QComboBox::activated, this, &VcsBaseEditorWidget::slotJumpToEntry); connect(this, &QPlainTextEdit::textChanged, this, &VcsBaseEditorWidget::slotPopulateLogBrowser); @@ -753,7 +753,7 @@ void VcsBaseEditorWidget::init() break; case DiffOutput: // Diff: set up diff file browsing - connect(d->entriesComboBox(), QOverload::of(&QComboBox::activated), + connect(d->entriesComboBox(), &QComboBox::activated, this, &VcsBaseEditorWidget::slotJumpToEntry); connect(this, &QPlainTextEdit::textChanged, this, &VcsBaseEditorWidget::slotPopulateDiffBrowser); diff --git a/src/plugins/vcsbase/vcsbaseeditorconfig.cpp b/src/plugins/vcsbase/vcsbaseeditorconfig.cpp index de7830698f4..0a6f580b581 100644 --- a/src/plugins/vcsbase/vcsbaseeditorconfig.cpp +++ b/src/plugins/vcsbase/vcsbaseeditorconfig.cpp @@ -196,8 +196,7 @@ QComboBox *VcsBaseEditorConfig::addChoices(const QString &title, cb->setToolTip(title); for (const ChoiceItem &item : items) cb->addItem(item.displayText, item.value); - connect(cb, QOverload::of(&QComboBox::currentIndexChanged), - this, &VcsBaseEditorConfig::argumentsChanged); + connect(cb, &QComboBox::currentIndexChanged, this, &VcsBaseEditorConfig::argumentsChanged); d->m_toolBar->addWidget(cb); d->m_optionMappings.append(OptionMapping(options, cb)); return cb;