diff options
author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-07-19 23:36:11 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-07-26 16:58:45 +0000 |
commit | 44f1fd64986ec542e468b18c3ea97cf363e975aa (patch) | |
tree | cd57d39c0fb6b2bc79f78b25624ee9c51ded8b9c | |
parent | ebd0dd6ebc916b978a5a2cf0139f40ae0b48a96f (diff) |
Drop Qt5: Cpp/TextEditor: Get rid of QOverload
Change-Id: I010f211b40f876c0f033fd717aaa094f775ea214
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r-- | src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp | 2 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppcodemodelinspectordialog.cpp | 3 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppcodemodelsettingspage.cpp | 6 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppeditoroutline.cpp | 6 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppeditorwidget.cpp | 4 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppinsertvirtualmethods.cpp | 2 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppparsecontext.cpp | 7 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppquickfixes.cpp | 4 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppuseselectionsupdater.cpp | 2 | ||||
-rw-r--r-- | src/plugins/texteditor/codeassist/codeassistant.cpp | 2 | ||||
-rw-r--r-- | src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp | 2 | ||||
-rw-r--r-- | src/plugins/texteditor/findinfiles.cpp | 6 | ||||
-rw-r--r-- | src/plugins/texteditor/snippets/snippetssettingspage.cpp | 2 | ||||
-rw-r--r-- | src/plugins/texteditor/texteditor.cpp | 13 |
14 files changed, 27 insertions, 34 deletions
diff --git a/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp b/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp index 7e17171d5d5..3bb4e290252 100644 --- a/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp +++ b/src/plugins/cppeditor/clangdiagnosticconfigswidget.cpp @@ -291,7 +291,7 @@ void ClangDiagnosticConfigsWidget::sync() return; disconnectClangOnlyOptionsChanged(); - Utils::ExecuteOnDestruction e([this]() { connectClangOnlyOptionsChanged(); }); + Utils::ExecuteOnDestruction e([this] { connectClangOnlyOptionsChanged(); }); // Update main button row const ClangDiagnosticConfig &config = currentConfig(); diff --git a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp index 437461de25e..c2a88cca68b 100644 --- a/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp +++ b/src/plugins/cppeditor/cppcodemodelinspectordialog.cpp @@ -1386,8 +1386,7 @@ CppCodeModelInspectorDialog::CppCodeModelInspectorDialog(QWidget *parent) this, &CppCodeModelInspectorDialog::onDocumentSelected); connect(m_snapshotView, &FilterableView::filterChanged, this, &CppCodeModelInspectorDialog::onSnapshotFilterChanged); - connect(m_ui->snapshotSelector, - QOverload<int>::of(&QComboBox::currentIndexChanged), + connect(m_ui->snapshotSelector, &QComboBox::currentIndexChanged, this, &CppCodeModelInspectorDialog::onSnapshotSelected); connect(m_ui->docSymbolsView, &QTreeView::expanded, this, &CppCodeModelInspectorDialog::onSymbolsViewExpandedOrCollapsed); diff --git a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp index c9d3b780886..c0aed77a4c3 100644 --- a/src/plugins/cppeditor/cppcodemodelsettingspage.cpp +++ b/src/plugins/cppeditor/cppcodemodelsettingspage.cpp @@ -390,13 +390,13 @@ ClangdSettingsWidget::ClangdSettingsWidget(const ClangdSettings::Data &settingsD this, &ClangdSettingsWidget::settingsDataChanged); connect(&d->autoIncludeHeadersCheckBox, &QCheckBox::toggled, this, &ClangdSettingsWidget::settingsDataChanged); - connect(&d->threadLimitSpinBox, qOverload<int>(&QSpinBox::valueChanged), + connect(&d->threadLimitSpinBox, &QSpinBox::valueChanged, this, &ClangdSettingsWidget::settingsDataChanged); connect(&d->sizeThresholdCheckBox, &QCheckBox::toggled, this, &ClangdSettingsWidget::settingsDataChanged); - connect(&d->sizeThresholdSpinBox, qOverload<int>(&QSpinBox::valueChanged), + connect(&d->sizeThresholdSpinBox, &QSpinBox::valueChanged, this, &ClangdSettingsWidget::settingsDataChanged); - connect(&d->documentUpdateThreshold, qOverload<int>(&QSpinBox::valueChanged), + connect(&d->documentUpdateThreshold, &QSpinBox::valueChanged, this, &ClangdSettingsWidget::settingsDataChanged); connect(&d->clangdChooser, &Utils::PathChooser::filePathChanged, this, &ClangdSettingsWidget::settingsDataChanged); diff --git a/src/plugins/cppeditor/cppeditoroutline.cpp b/src/plugins/cppeditor/cppeditoroutline.cpp index 873acd183d2..b4e9678d917 100644 --- a/src/plugins/cppeditor/cppeditoroutline.cpp +++ b/src/plugins/cppeditor/cppeditoroutline.cpp @@ -123,10 +123,8 @@ CppEditorOutline::CppEditorOutline(TextEditor::TextEditorWidget *editorWidget) &CppToolsSettings::setSortedEditorDocumentOutline); m_combo->addAction(m_sortAction); - connect(m_combo, QOverload<int>::of(&QComboBox::activated), - this, &CppEditorOutline::gotoSymbolInEditor); - connect(m_combo, QOverload<int>::of(&QComboBox::currentIndexChanged), - this, &CppEditorOutline::updateToolTip); + connect(m_combo, &QComboBox::activated, this, &CppEditorOutline::gotoSymbolInEditor); + connect(m_combo, &QComboBox::currentIndexChanged, this, &CppEditorOutline::updateToolTip); // Set up timers m_updateTimer = newSingleShotTimer(this, UpdateOutlineIntervalInMs, diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index f797a59ffdd..5b2134b99bb 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -513,7 +513,7 @@ void CppEditorWidget::finalizeInitialization() connect(this, &QPlainTextEdit::textChanged, this, &CppEditorWidget::updateFunctionDeclDefLink); // set up the use highlighitng - connect(this, &CppEditorWidget::cursorPositionChanged, this, [this]() { + connect(this, &CppEditorWidget::cursorPositionChanged, this, [this] { if (!d->m_localRenaming.isActive()) d->m_useSelectionsUpdater.scheduleUpdate(); @@ -1182,7 +1182,7 @@ AssistInterface *CppEditorWidget::createAssistInterface(AssistKind kind, AssistR ? qobject_cast<CppCompletionAssistProvider *>(cppEditorDocument()->completionAssistProvider()) : qobject_cast<CppCompletionAssistProvider *>(cppEditorDocument()->functionHintAssistProvider()); - auto getFeatures = [this]() { + auto getFeatures = [this] { LanguageFeatures features = LanguageFeatures::defaultFeatures(); if (Document::Ptr doc = d->m_lastSemanticInfo.doc) features = doc->languageFeatures(); diff --git a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp index 8ca840e1282..6a6ebe25a45 100644 --- a/src/plugins/cppeditor/cppinsertvirtualmethods.cpp +++ b/src/plugins/cppeditor/cppinsertvirtualmethods.cpp @@ -1070,7 +1070,7 @@ void InsertVirtualMethodsDialog::initGui() auto clearUserAddedReplacements = new QAction(this); clearUserAddedReplacements->setIcon(Utils::Icons::CLEAN_TOOLBAR.icon()); clearUserAddedReplacements->setText(tr("Clear Added \"override\" Equivalents")); - connect(clearUserAddedReplacements, &QAction::triggered, [this]() { + connect(clearUserAddedReplacements, &QAction::triggered, [this] { m_availableOverrideReplacements = defaultOverrideReplacements(); updateOverrideReplacementsComboBox(); m_clearUserAddedReplacementsButton->setEnabled(false); diff --git a/src/plugins/cppeditor/cppparsecontext.cpp b/src/plugins/cppeditor/cppparsecontext.cpp index 08b5362a0a8..947ae4f8b27 100644 --- a/src/plugins/cppeditor/cppparsecontext.cpp +++ b/src/plugins/cppeditor/cppparsecontext.cpp @@ -144,16 +144,13 @@ ParseContextWidget::ParseContextWidget(ParseContextModel &parseContextModel, QWi // Set up context menu with a clear action setContextMenuPolicy(Qt::ActionsContextMenu); m_clearPreferredAction = new QAction(tr("Clear Preferred Parse Context"), this); - connect(m_clearPreferredAction, &QAction::triggered, this, [this]() { + connect(m_clearPreferredAction, &QAction::triggered, this, [this] { m_parseContextModel.clearPreferred(); }); addAction(m_clearPreferredAction); // Set up sync of this widget and model in both directions - connect(this, - QOverload<int>::of(&QComboBox::activated), - &m_parseContextModel, - &ParseContextModel::setPreferred); + connect(this, &QComboBox::activated, &m_parseContextModel, &ParseContextModel::setPreferred); connect(&m_parseContextModel, &ParseContextModel::updated, this, &ParseContextWidget::syncToModel); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index 207b0c90fe7..4052f8c4cca 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -3138,7 +3138,7 @@ public: if (!implFile.isEmpty()) implTargetStrings.append(implFile.fileName()); defaultImplTargetComboBox->insertItems(0, implTargetStrings); - connect(defaultImplTargetComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, + connect(defaultImplTargetComboBox, &QComboBox::currentIndexChanged, this, [this](int index) { for (int i = 0; i < m_implTargetBoxes.size(); ++i) { if (!m_candidates.at(i)->type()->asFunctionType()->isPureVirtual()) @@ -8762,7 +8762,7 @@ public: using A = InsertionPointLocator::AccessSpec; auto accessCombo = new QComboBox; - connect(accessCombo, qOverload<int>(&QComboBox::currentIndexChanged), [this, accessCombo]() { + connect(accessCombo, &QComboBox::currentIndexChanged, this, [this, accessCombo] { const auto data = accessCombo->currentData(); m_accessSpec = static_cast<A>(data.toInt()); }); diff --git a/src/plugins/cppeditor/cppuseselectionsupdater.cpp b/src/plugins/cppeditor/cppuseselectionsupdater.cpp index babff089b7f..2a409c794b8 100644 --- a/src/plugins/cppeditor/cppuseselectionsupdater.cpp +++ b/src/plugins/cppeditor/cppuseselectionsupdater.cpp @@ -47,7 +47,7 @@ CppUseSelectionsUpdater::CppUseSelectionsUpdater(CppEditorWidget *editorWidget) { m_timer.setSingleShot(true); m_timer.setInterval(updateUseSelectionsInternalInMs); - connect(&m_timer, &QTimer::timeout, this, [this]() { update(); }); + connect(&m_timer, &QTimer::timeout, this, [this] { update(); }); } CppUseSelectionsUpdater::~CppUseSelectionsUpdater() diff --git a/src/plugins/texteditor/codeassist/codeassistant.cpp b/src/plugins/texteditor/codeassist/codeassistant.cpp index 6613042c52b..d0e5d37812b 100644 --- a/src/plugins/texteditor/codeassist/codeassistant.cpp +++ b/src/plugins/texteditor/codeassist/codeassistant.cpp @@ -200,7 +200,7 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason, bool isUpdate) { // make sure to cleanup old proposals if we cannot find a new assistant - Utils::ExecuteOnDestruction earlyReturnContextClear([this]() { destroyContext(); }); + Utils::ExecuteOnDestruction earlyReturnContextClear([this] { destroyContext(); }); if (isWaitingForProposal()) cancelCurrentRequest(); diff --git a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp index aab407acdbe..4918b93f92e 100644 --- a/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp +++ b/src/plugins/texteditor/codeassist/functionhintproposalwidget.cpp @@ -154,7 +154,7 @@ FunctionHintProposalWidget::FunctionHintProposalWidget() connect(upArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::previousPage); connect(downArrow, &QAbstractButton::clicked, this, &FunctionHintProposalWidget::nextPage); - connect(d->m_popupFrame.data(), &QObject::destroyed, this, [this](){ + connect(d->m_popupFrame.data(), &QObject::destroyed, this, [this] { qApp->removeEventFilter(this); deleteLater(); }); diff --git a/src/plugins/texteditor/findinfiles.cpp b/src/plugins/texteditor/findinfiles.cpp index 7f135af611b..f5f2b175368 100644 --- a/src/plugins/texteditor/findinfiles.cpp +++ b/src/plugins/texteditor/findinfiles.cpp @@ -153,8 +153,8 @@ QWidget *FindInFiles::createConfigWidget() auto searchEngineLabel = new QLabel(tr("Search engine:")); gridLayout->addWidget(searchEngineLabel, row, 0, Qt::AlignRight); m_searchEngineCombo = new QComboBox; - auto cc = QOverload<int>::of(&QComboBox::currentIndexChanged); - connect(m_searchEngineCombo, cc, this, &FindInFiles::searchEnginesSelectionChanged); + connect(m_searchEngineCombo, &QComboBox::currentIndexChanged, + this, &FindInFiles::searchEnginesSelectionChanged); searchEngineLabel->setBuddy(m_searchEngineCombo); gridLayout->addWidget(m_searchEngineCombo, row, 1); @@ -194,7 +194,7 @@ QWidget *FindInFiles::createConfigWidget() m_configWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); // validity - auto updateValidity = [this]() { + auto updateValidity = [this] { setValid(currentSearchEngine()->isEnabled() && m_directory->isValid()); }; connect(this, &BaseFileFind::currentSearchEngineChanged, this, updateValidity); diff --git a/src/plugins/texteditor/snippets/snippetssettingspage.cpp b/src/plugins/texteditor/snippets/snippetssettingspage.cpp index c69002f6b9f..f7f0f647664 100644 --- a/src/plugins/texteditor/snippets/snippetssettingspage.cpp +++ b/src/plugins/texteditor/snippets/snippetssettingspage.cpp @@ -353,7 +353,7 @@ void SnippetsSettingsPagePrivate::configureUi(QWidget *w) connect(m_model, &QAbstractItemModel::modelReset, this, &SnippetsSettingsPagePrivate::markSnippetsCollection); - connect(m_ui.groupCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), + connect(m_ui.groupCombo, &QComboBox::currentIndexChanged, this, &SnippetsSettingsPagePrivate::loadSnippetGroup); connect(m_ui.addButton, &QAbstractButton::clicked, this, &SnippetsSettingsPagePrivate::addSnippet); diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index d24a5a6e41a..aac38ac2dab 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -864,7 +864,7 @@ void TextEditorWidgetFind::selectAll(const QString &txt, FindFlags findFlags) m_selectWatcher = new QFutureWatcher<FileSearchResultList>(); connect(m_selectWatcher, &QFutureWatcher<Utils::FileSearchResultList>::finished, - this, [this]() { + this, [this] { const QFuture<FileSearchResultList> future = m_selectWatcher->future(); m_selectWatcher->deleteLater(); m_selectWatcher = nullptr; @@ -1214,7 +1214,7 @@ void TextEditorWidgetPrivate::ctor(const QSharedPointer<TextDocument> &doc) q, &TextEditorWidget::updateTextCodecLabel); q->updateTextCodecLabel(); - connect(m_fileLineEnding, QOverload<int>::of(&QComboBox::currentIndexChanged), + connect(m_fileLineEnding, &QComboBox::currentIndexChanged, q, &TextEditorWidget::selectLineEnding); connect(m_document->document(), &QTextDocument::modificationChanged, q, &TextEditorWidget::updateTextLineEndingLabel); @@ -1611,7 +1611,7 @@ void TextEditorWidgetPrivate::updateCannotDecodeInfo() InfoBarEntry info(selectEncodingId, TextEditorWidget::tr("<b>Error:</b> Could not decode \"%1\" with \"%2\"-encoding. Editing not possible.") .arg(m_document->displayName(), QString::fromLatin1(m_document->codec()->name()))); - info.addCustomButton(TextEditorWidget::tr("Select Encoding"), [this]() { q->selectEncoding(); }); + info.addCustomButton(TextEditorWidget::tr("Select Encoding"), [this] { q->selectEncoding(); }); infoBar->addInfo(info); } else { infoBar->removeInfo(selectEncodingId); @@ -3484,8 +3484,7 @@ void TextEditorWidgetPrivate::setupDocumentSignals() QObject::connect(m_document.data(), &TextDocument::reloadFinished, this, &TextEditorWidgetPrivate::documentReloadFinished); - QObject::connect(m_document.data(), &TextDocument::tabSettingsChanged, - this, [this](){ + QObject::connect(m_document.data(), &TextDocument::tabSettingsChanged, this, [this] { updateTabStops(); m_autoCompleter->setTabSettings(m_document->tabSettings()); }); @@ -5240,7 +5239,7 @@ void TextEditorWidgetPrivate::updateHighlights() } if (m_highlightAutoComplete && !m_autoCompleteHighlightPos.isEmpty()) { - QMetaObject::invokeMethod(this, [this]() { + QMetaObject::invokeMethod(this, [this] { const QTextCursor &cursor = q->textCursor(); auto popAutoCompletion = [&]() { return !m_autoCompleteHighlightPos.isEmpty() @@ -8047,7 +8046,7 @@ bool TextEditorWidget::inFindScope(const QTextCursor &cursor) const void TextEditorWidget::updateVisualWrapColumn() { - auto calcMargin = [this]() { + auto calcMargin = [this] { const auto &ms = d->m_marginSettings; if (!ms.m_showMargin) { |