Drop Qt5: VCS: Get rid of QComboBox QOverload

Change-Id: Ib2f21f28a0ec16b817f9227c6234424001752d50
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-07-19 22:57:37 +02:00
parent ae9a330344
commit 60a5f77ef2
8 changed files with 15 additions and 20 deletions

View File

@@ -65,8 +65,7 @@ ActivitySelector::ActivitySelector(QWidget *parent) : QWidget(parent)
connect(btnAdd, &QToolButton::clicked, this, &ActivitySelector::newActivity); connect(btnAdd, &QToolButton::clicked, this, &ActivitySelector::newActivity);
refresh(); refresh();
connect(m_cmbActivity, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_cmbActivity, &QComboBox::currentIndexChanged, this, &ActivitySelector::userChanged);
this, &ActivitySelector::userChanged);
} }
void ActivitySelector::userChanged() void ActivitySelector::userChanged()
@@ -102,10 +101,10 @@ void ActivitySelector::setActivity(const QString &act)
{ {
int index = m_cmbActivity->findData(act); int index = m_cmbActivity->findData(act);
if (index != -1) { if (index != -1) {
disconnect(m_cmbActivity, QOverload<int>::of(&QComboBox::currentIndexChanged), disconnect(m_cmbActivity, &QComboBox::currentIndexChanged,
this, &ActivitySelector::userChanged); this, &ActivitySelector::userChanged);
m_cmbActivity->setCurrentIndex(index); m_cmbActivity->setCurrentIndex(index);
connect(m_cmbActivity, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_cmbActivity, &QComboBox::currentIndexChanged,
this, &ActivitySelector::userChanged); this, &ActivitySelector::userChanged);
} }
} }

View File

@@ -147,10 +147,10 @@ GerritPushDialog::GerritPushDialog(const Utils::FilePath &workingDir, const QStr
} }
m_ui->localBranchComboBox->init(workingDir); m_ui->localBranchComboBox->init(workingDir);
connect(m_ui->localBranchComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_ui->localBranchComboBox, &QComboBox::currentIndexChanged,
this, &GerritPushDialog::updateCommits); this, &GerritPushDialog::updateCommits);
connect(m_ui->targetBranchComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_ui->targetBranchComboBox, &QComboBox::currentIndexChanged,
this, &GerritPushDialog::setChangeRange); this, &GerritPushDialog::setChangeRange);
connect(m_ui->targetBranchComboBox, &QComboBox::currentTextChanged, connect(m_ui->targetBranchComboBox, &QComboBox::currentTextChanged,

View File

@@ -57,7 +57,7 @@ GitLabDialog::GitLabDialog(QWidget *parent)
updateRemotes(); updateRemotes();
connect(m_ui.remoteCB, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_ui.remoteCB, &QComboBox::currentIndexChanged,
this, &GitLabDialog::requestMainViewUpdate); this, &GitLabDialog::requestMainViewUpdate);
connect(m_ui.searchLE, &QLineEdit::returnPressed, this, &GitLabDialog::querySearch); connect(m_ui.searchLE, &QLineEdit::returnPressed, this, &GitLabDialog::querySearch);
connect(m_ui.searchPB, &QPushButton::clicked, this, &GitLabDialog::querySearch); connect(m_ui.searchPB, &QPushButton::clicked, this, &GitLabDialog::querySearch);

View File

@@ -156,8 +156,7 @@ GitLabOptionsWidget::GitLabOptionsWidget(QWidget *parent)
connect(m_edit, &QPushButton::clicked, this, &GitLabOptionsWidget::showEditServerDialog); connect(m_edit, &QPushButton::clicked, this, &GitLabOptionsWidget::showEditServerDialog);
connect(m_remove, &QPushButton::clicked, this, &GitLabOptionsWidget::removeCurrentTriggered); connect(m_remove, &QPushButton::clicked, this, &GitLabOptionsWidget::removeCurrentTriggered);
connect(m_add, &QPushButton::clicked, this, &GitLabOptionsWidget::showAddServerDialog); connect(m_add, &QPushButton::clicked, this, &GitLabOptionsWidget::showAddServerDialog);
connect(m_defaultGitLabServer, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_defaultGitLabServer, &QComboBox::currentIndexChanged, this, [this] {
this, [this]() {
m_gitLabServerWidget->setGitLabServer( m_gitLabServerWidget->setGitLabServer(
m_defaultGitLabServer->currentData().value<GitLabServer>()); m_defaultGitLabServer->currentData().value<GitLabServer>());
}); });

View File

@@ -163,20 +163,18 @@ GitLabProjectSettingsWidget::GitLabProjectSettingsWidget(ProjectExplorer::Projec
verticalLayout->addWidget(new QLabel(tr("Projects linked with GitLab receive event " verticalLayout->addWidget(new QLabel(tr("Projects linked with GitLab receive event "
"notifications in the Version Control output pane."))); "notifications in the Version Control output pane.")));
connect(m_linkWithGitLab, &QPushButton::clicked, this, [this]() { connect(m_linkWithGitLab, &QPushButton::clicked, this, [this] {
checkConnection(Link); checkConnection(Link);
}); });
connect(m_unlink, &QPushButton::clicked, connect(m_unlink, &QPushButton::clicked,
this, &GitLabProjectSettingsWidget::unlink); this, &GitLabProjectSettingsWidget::unlink);
connect(m_checkConnection, &QPushButton::clicked, this, [this]() { connect(m_checkConnection, &QPushButton::clicked, this, [this] {
checkConnection(Connection); checkConnection(Connection);
}); });
connect(m_linkedGitLabServer, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_linkedGitLabServer, &QComboBox::currentIndexChanged, this, [this] {
this, [this]() {
m_infoLabel->setVisible(false); m_infoLabel->setVisible(false);
}); });
connect(m_hostCB, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_hostCB, &QComboBox::currentIndexChanged, this, [this] {
this, [this]() {
m_infoLabel->setVisible(false); m_infoLabel->setVisible(false);
}); });
connect(GitLabPlugin::optionsPage(), &GitLabOptionsPage::settingsChanged, connect(GitLabPlugin::optionsPage(), &GitLabOptionsPage::settingsChanged,

View File

@@ -286,7 +286,7 @@ void SubmitFieldWidget::createField(const QString &f)
if (d->completer) if (d->completer)
fe.lineEdit->setCompleter(d->completer); fe.lineEdit->setCompleter(d->completer);
connect(fe.combo, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(fe.combo, &QComboBox::currentIndexChanged,
this, &SubmitFieldWidget::slotComboIndexChanged); this, &SubmitFieldWidget::slotComboIndexChanged);
connect(fe.clearButton, &QAbstractButton::clicked, connect(fe.clearButton, &QAbstractButton::clicked,
this, &SubmitFieldWidget::slotRemove); this, &SubmitFieldWidget::slotRemove);

View File

@@ -740,7 +740,7 @@ void VcsBaseEditorWidget::init()
case OtherContent: case OtherContent:
break; break;
case LogOutput: case LogOutput:
connect(d->entriesComboBox(), QOverload<int>::of(&QComboBox::activated), connect(d->entriesComboBox(), &QComboBox::activated,
this, &VcsBaseEditorWidget::slotJumpToEntry); this, &VcsBaseEditorWidget::slotJumpToEntry);
connect(this, &QPlainTextEdit::textChanged, connect(this, &QPlainTextEdit::textChanged,
this, &VcsBaseEditorWidget::slotPopulateLogBrowser); this, &VcsBaseEditorWidget::slotPopulateLogBrowser);
@@ -753,7 +753,7 @@ void VcsBaseEditorWidget::init()
break; break;
case DiffOutput: case DiffOutput:
// Diff: set up diff file browsing // Diff: set up diff file browsing
connect(d->entriesComboBox(), QOverload<int>::of(&QComboBox::activated), connect(d->entriesComboBox(), &QComboBox::activated,
this, &VcsBaseEditorWidget::slotJumpToEntry); this, &VcsBaseEditorWidget::slotJumpToEntry);
connect(this, &QPlainTextEdit::textChanged, connect(this, &QPlainTextEdit::textChanged,
this, &VcsBaseEditorWidget::slotPopulateDiffBrowser); this, &VcsBaseEditorWidget::slotPopulateDiffBrowser);

View File

@@ -196,8 +196,7 @@ QComboBox *VcsBaseEditorConfig::addChoices(const QString &title,
cb->setToolTip(title); cb->setToolTip(title);
for (const ChoiceItem &item : items) for (const ChoiceItem &item : items)
cb->addItem(item.displayText, item.value); cb->addItem(item.displayText, item.value);
connect(cb, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(cb, &QComboBox::currentIndexChanged, this, &VcsBaseEditorConfig::argumentsChanged);
this, &VcsBaseEditorConfig::argumentsChanged);
d->m_toolBar->addWidget(cb); d->m_toolBar->addWidget(cb);
d->m_optionMappings.append(OptionMapping(options, cb)); d->m_optionMappings.append(OptionMapping(options, cb));
return cb; return cb;