diff options
Diffstat (limited to 'src/plugins/cppeditor')
-rw-r--r-- | src/plugins/cppeditor/cppeditorwidget.cpp | 12 | ||||
-rw-r--r-- | src/plugins/cppeditor/cppquickfixes.cpp | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/cppeditor/cppeditorwidget.cpp b/src/plugins/cppeditor/cppeditorwidget.cpp index 0eabd42e30..5882c8d164 100644 --- a/src/plugins/cppeditor/cppeditorwidget.cpp +++ b/src/plugins/cppeditor/cppeditorwidget.cpp @@ -616,12 +616,11 @@ void CppEditorWidget::renameUsages(const QString &replacement, QTextCursor curso cursor = textCursor(); // First check if the symbol to be renamed comes from a generated file. - LinkHandler continuation = [=, self = QPointer(this)](const Link &link) { + LinkHandler continuation = [this, cursor, replacement, self = QPointer(this)](const Link &link) { if (!self) return; showRenameWarningIfFileIsGenerated(link.targetFilePath); - CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this, textDocument()}; - QPointer<CppEditorWidget> cppEditorWidget = this; + const CursorInEditor cursorInEditor{cursor, textDocument()->filePath(), this, textDocument()}; CppModelManager::globalRename(cursorInEditor, replacement); }; CppModelManager::followSymbol(CursorInEditor{cursor, @@ -847,7 +846,8 @@ void CppEditorWidget::renameSymbolUnderCursor() QPointer<CppEditorWidget> cppEditorWidget = this; - auto renameSymbols = [=](const QString &symbolName, const Links &links, int revision) { + auto renameSymbols = [this, cppEditorWidget](const QString &symbolName, const Links &links, + int revision) { if (cppEditorWidget) { viewport()->setCursor(Qt::IBeamCursor); @@ -1121,8 +1121,8 @@ QMenu *CppEditorWidget::createRefactorMenu(QWidget *parent) const auto *progressIndicatorMenuItem = new ProgressIndicatorMenuItem(menu); menu->addAction(progressIndicatorMenuItem); - connect(&d->m_useSelectionsUpdater, &CppUseSelectionsUpdater::finished, - menu, [=] (SemanticInfo::LocalUseMap, bool success) { + connect(&d->m_useSelectionsUpdater, &CppUseSelectionsUpdater::finished, menu, + [this, menu, progressIndicatorMenuItem] (SemanticInfo::LocalUseMap, bool success) { QTC_CHECK(success); menu->removeAction(progressIndicatorMenuItem); addRefactoringActions(menu); diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp index b4a844b396..5c40ad9ce8 100644 --- a/src/plugins/cppeditor/cppquickfixes.cpp +++ b/src/plugins/cppeditor/cppquickfixes.cpp @@ -4783,8 +4783,9 @@ public: checkbox->setCheckState(Qt::Checked); }; using Column = CandidateTreeItem::Column; - const auto createConnections = [=](QCheckBox *checkbox, Column column) { - connect(checkbox, &QCheckBox::stateChanged, [setCheckStateForAll, column](int state) { + const auto createConnections = [this, setCheckStateForAll, preventPartiallyChecked]( + QCheckBox *checkbox, Column column) { + connect(checkbox, &QCheckBox::stateChanged, this, [setCheckStateForAll, column](int state) { if (state != Qt::PartiallyChecked) setCheckStateForAll(column, state); }); |