diff --git a/src/libs/utils/filestreamer.cpp b/src/libs/utils/filestreamer.cpp index e80c8e5bd0c..053d5dfc312 100644 --- a/src/libs/utils/filestreamer.cpp +++ b/src/libs/utils/filestreamer.cpp @@ -98,7 +98,7 @@ private: const auto setup = [this](Async &async) { async.setConcurrentCallData(localRead, m_filePath); Async *asyncPtr = &async; - connect(asyncPtr, &AsyncBase::resultReadyAt, this, [=](int index) { + connect(asyncPtr, &AsyncBase::resultReadyAt, this, [this, asyncPtr](int index) { emit readyRead(asyncPtr->resultAt(index)); }); }; diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index d1a8f812189..4283bc89972 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -2122,7 +2122,7 @@ void ProcessPrivate::setupDebugLog() return duration_cast(system_clock::now().time_since_epoch()).count(); }; - connect(q, &Process::starting, this, [=] { + connect(q, &Process::starting, this, [this, now] { const quint64 msNow = now(); setProperty(QTC_PROCESS_STARTTIME, msNow); @@ -2135,7 +2135,7 @@ void ProcessPrivate::setupDebugLog() setProperty(QTC_PROCESS_NUMBER, currentNumber); }); - connect(q, &Process::done, this, [=] { + connect(q, &Process::done, this, [this, now] { if (!m_process.get()) return; const QVariant n = property(QTC_PROCESS_NUMBER); diff --git a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverviewer.cpp b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverviewer.cpp index dbe371eeb7d..8e5a98fc08e 100644 --- a/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverviewer.cpp +++ b/src/plugins/baremetal/debugservers/uvsc/uvtargetdriverviewer.cpp @@ -80,7 +80,7 @@ DriverSelector::DriverSelector(const QStringList &supportedDrivers, QWidget *par const auto detailsPanel = new DriverSelectorDetailsPanel(m_selection); setWidget(detailsPanel); - connect(toolPanel, &DriverSelectorToolPanel::clicked, this, [=]() { + connect(toolPanel, &DriverSelectorToolPanel::clicked, this, [=] { DriverSelectionDialog dialog(m_toolsIniFile, supportedDrivers, this); const int result = dialog.exec(); if (result != QDialog::Accepted) diff --git a/src/plugins/clangtools/filterdialog.cpp b/src/plugins/clangtools/filterdialog.cpp index bcb81346d03..3486cb12615 100644 --- a/src/plugins/clangtools/filterdialog.cpp +++ b/src/plugins/clangtools/filterdialog.cpp @@ -96,7 +96,7 @@ FilterDialog::FilterDialog(const Checks &checks, QWidget *parent) }.attachTo(this); connect(m_view->selectionModel(), &QItemSelectionModel::selectionChanged, this, [=] { - const bool hasSelection = !m_view->selectionModel()->selectedRows().isEmpty(); + const bool hasSelection = !this->m_view->selectionModel()->selectedRows().isEmpty(); buttonBox->button(QDialogButtonBox::Ok)->setEnabled(hasSelection); }); diff --git a/src/plugins/git/branchview.cpp b/src/plugins/git/branchview.cpp index 4b846d38e54..a5307536da3 100644 --- a/src/plugins/git/branchview.cpp +++ b/src/plugins/git/branchview.cpp @@ -425,9 +425,11 @@ bool BranchView::checkout() return false; } - const bool moveChanges = branchCheckoutDialog.moveLocalChangesToNextBranch(); - const bool popStash = branchCheckoutDialog.popStashOfNextBranch(); - const auto commandHandler = [=](const CommandResult &) { + const auto commandHandler = [this, + moveChanges = branchCheckoutDialog.moveLocalChangesToNextBranch(), + popStash = branchCheckoutDialog.popStashOfNextBranch(), + popMessageStart + ](const CommandResult &) { if (moveChanges) { gitClient().endStashScope(m_repository); } else if (popStash) { diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index dca467c632a..c457bdd75e0 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -238,7 +238,7 @@ GitDiffEditorController::GitDiffEditorController(IDocument *document, { const Storage diffInputStorage; - const auto onDiffSetup = [=](Process &process) { + const auto onDiffSetup = [this, leftCommit, rightCommit, extraArgs](Process &process) { process.setCodec(VcsBaseEditor::getCodec(workingDirectory(), {})); setupCommand(process, {addConfigurationArguments(diffArgs(leftCommit, rightCommit, extraArgs))}); VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine()); @@ -3148,7 +3148,7 @@ static PushFailure handleError(const QString &text, QString *pushFallbackCommand void GitClient::push(const FilePath &workingDirectory, const QStringList &pushArgs) { - const auto commandHandler = [=](const CommandResult &result) { + const auto commandHandler = [this, workingDirectory, pushArgs](const CommandResult &result) { QString pushFallbackCommand; const PushFailure pushFailure = handleError(result.cleanedStdErr(), &pushFallbackCommand); diff --git a/src/plugins/languageclient/languageclientsettings.cpp b/src/plugins/languageclient/languageclientsettings.cpp index a9fc9ebf6e9..ae0a7d6c3a9 100644 --- a/src/plugins/languageclient/languageclientsettings.cpp +++ b/src/plugins/languageclient/languageclientsettings.cpp @@ -1134,7 +1134,7 @@ public: connect(editor->editorWidget()->textDocument(), &TextEditor::TextDocument::contentsChanged, this, - [=]() { m_settings.setJson(editor->document()->contents()); }); + [=] { m_settings.setJson(editor->document()->contents()); }); } private: diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index e80ab8eabc6..93713466811 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -55,7 +55,7 @@ MercurialDiffEditorController::MercurialDiffEditorController(IDocument *document const Storage diffInputStorage; - const auto onDiffSetup = [=](Process &process) { + const auto onDiffSetup = [this, args](Process &process) { setupCommand(process, {addConfigurationArguments(args)}); VcsOutputWindow::appendCommand(process.workingDirectory(), process.commandLine()); }; diff --git a/src/plugins/python/pyside.cpp b/src/plugins/python/pyside.cpp index 3c203778d0e..8d3b1d31a38 100644 --- a/src/plugins/python/pyside.cpp +++ b/src/plugins/python/pyside.cpp @@ -125,7 +125,7 @@ void PySideInstaller::installPyside(const FilePath &python, connect(install, &PipInstallTask::finished, install, &QObject::deleteLater); connect(install, &PipInstallTask::finished, this, [=](bool success){ if (success) - emit pySideInstalled(python, pySide); + emit this->pySideInstalled(python, pySide); }); if (availablePySides.isEmpty()) { install->setPackages({PipPackage(pySide)}); @@ -193,7 +193,7 @@ void PySideInstaller::handlePySideMissing(const FilePath &python, const QString message = Tr::tr("%1 installation missing for %2 (%3)") .arg(pySide, pythonName(python), python.toUserOutput()); InfoBarEntry info(installPySideInfoBarId, message, InfoBarEntry::GlobalSuppression::Enabled); - auto installCallback = [=]() { installPyside(python, pySide, document); }; + auto installCallback = [=] { this->installPyside(python, pySide, document); }; const QString installTooltip = Tr::tr("Install %1 for %2 using pip package installer.") .arg(pySide, python.toUserOutput()); info.addCustomButton(Tr::tr("Install"), installCallback, installTooltip); diff --git a/src/plugins/python/pythonbuildconfiguration.cpp b/src/plugins/python/pythonbuildconfiguration.cpp index edebdcfe169..9728dc44515 100644 --- a/src/plugins/python/pythonbuildconfiguration.cpp +++ b/src/plugins/python/pythonbuildconfiguration.cpp @@ -112,7 +112,7 @@ void PySideBuildStep::checkForPySide(const FilePath &python, const QString &pySi QObject::disconnect(m_watcherConnection); m_watcher.reset(new QFutureWatcher()); m_watcherConnection = QObject::connect(m_watcher.get(), &QFutureWatcherBase::finished, this, [=] { - handlePySidePackageInfo(m_watcher->result(), python, pySidePackageName); + this->handlePySidePackageInfo(m_watcher->result(), python, pySidePackageName); }); const auto future = Pip::instance(python)->info(package); m_watcher->setFuture(future); @@ -258,7 +258,7 @@ PythonBuildConfiguration::PythonBuildConfiguration(Target *target, const Id &id) this, &PythonBuildConfiguration::handlePythonUpdated); - auto update = [this]() { + auto update = [this] { if (isActive()) { m_buildSystem->emitBuildSystemUpdated(); const FilePaths files = project()->files(Project::AllFiles); diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp index 6383cca20bd..a6bb9fcaa81 100644 --- a/src/plugins/python/pythonlanguageclient.cpp +++ b/src/plugins/python/pythonlanguageclient.cpp @@ -354,7 +354,7 @@ void PyLSConfigureAssistant::handlePyLSState(const FilePath &python, message, Utils::InfoBarEntry::GlobalSuppression::Enabled); info.addCustomButton(Tr::tr("Install"), [=]() { - installPythonLanguageServer(python, document, state.pylsModulePath); + this->installPythonLanguageServer(python, document, state.pylsModulePath); }); infoBar->addInfo(info); m_infoBarEntries[python] << document; diff --git a/src/plugins/screenrecorder/record.cpp b/src/plugins/screenrecorder/record.cpp index 12aa27f46da..056043a11c6 100644 --- a/src/plugins/screenrecorder/record.cpp +++ b/src/plugins/screenrecorder/record.cpp @@ -254,18 +254,18 @@ RecordWidget::RecordWidget(const FilePath &recordFile, QWidget *parent) recordButton->setEnabled(false); stopButton->setEnabled(true); settingsButton->setEnabled(false); - m_openClipAction->setEnabled(false); + this->m_openClipAction->setEnabled(false); emit started(); }); connect(m_process, &Process::done, this, [=] { recordButton->setEnabled(true); stopButton->setEnabled(false); settingsButton->setEnabled(true); - m_openClipAction->setEnabled(true); - if (m_process->exitCode() == 0) - emit finished(FFmpegUtils::clipInfo(m_clipInfo.file)); + this->m_openClipAction->setEnabled(true); + if (this->m_process->exitCode() == 0) + emit finished(FFmpegUtils::clipInfo(this->m_clipInfo.file)); else - FFmpegUtils::reportError(m_process->commandLine(), m_lastOutputChunk); + FFmpegUtils::reportError(this->m_process->commandLine(), this->m_lastOutputChunk); }); connect(m_process, &Process::readyReadStandardError, this, [this, progressLabel] { m_lastOutputChunk = m_process->readAllRawStandardError(); diff --git a/src/plugins/scxmleditor/common/mainwidget.cpp b/src/plugins/scxmleditor/common/mainwidget.cpp index a55d59f6ad1..a023c0b8e7b 100644 --- a/src/plugins/scxmleditor/common/mainwidget.cpp +++ b/src/plugins/scxmleditor/common/mainwidget.cpp @@ -347,7 +347,7 @@ void MainWidget::init() // Connect alignment change alignToolButton->setProperty("currentAlignment", ActionAlignLeft); connect(alignToolButton, &QToolButton::clicked, this, [=] { - StateView *view = m_views.last(); + StateView *view = this->m_views.last(); if (view) view->scene()->alignStates(alignToolButton->property("currentAlignment").toInt()); }); @@ -355,7 +355,7 @@ void MainWidget::init() // Connect alignment change adjustToolButton->setProperty("currentAdjustment", ActionAdjustWidth); connect(adjustToolButton, &QToolButton::clicked, this, [=] { - StateView *view = m_views.last(); + StateView *view = this->m_views.last(); if (view) view->scene()->adjustStates(adjustToolButton->property("currentAdjustment").toInt()); }); diff --git a/src/plugins/scxmleditor/outputpane/outputtabwidget.cpp b/src/plugins/scxmleditor/outputpane/outputtabwidget.cpp index 3803acfac37..b4b28883ac6 100644 --- a/src/plugins/scxmleditor/outputpane/outputtabwidget.cpp +++ b/src/plugins/scxmleditor/outputpane/outputtabwidget.cpp @@ -43,11 +43,11 @@ PaneTitleButton::PaneTitleButton(OutputPane *pane, QWidget *parent) }); connect(pane, &OutputPane::titleChanged, this, [=] { - setText(pane->title()); + this->setText(pane->title()); }); connect(pane, &OutputPane::iconChanged, this, [=] { - setIcon(pane->icon()); + this->setIcon(pane->icon()); }); }