diff --git a/src/plugins/scxmleditor/common/colorthemes.cpp b/src/plugins/scxmleditor/common/colorthemes.cpp index 3af2a93ab52..4afe86fd3b2 100644 --- a/src/plugins/scxmleditor/common/colorthemes.cpp +++ b/src/plugins/scxmleditor/common/colorthemes.cpp @@ -82,7 +82,7 @@ void ColorThemes::updateColorThemeMenu() ? Tr::tr("Factory Default") : key == Constants::C_COLOR_SCHEME_SCXMLDOCUMENT ? Tr::tr("Colors from SCXML Document") : key; - QAction *action = m_menu->addAction(actionText, this, [this, key]() { + QAction *action = m_menu->addAction(actionText, this, [this, key] { selectColorTheme(key); }); action->setData(key); diff --git a/src/plugins/scxmleditor/common/colortoolbutton.cpp b/src/plugins/scxmleditor/common/colortoolbutton.cpp index 98ecec9011e..5a7e07955c1 100644 --- a/src/plugins/scxmleditor/common/colortoolbutton.cpp +++ b/src/plugins/scxmleditor/common/colortoolbutton.cpp @@ -32,7 +32,7 @@ ColorToolButton::ColorToolButton(const QString &key, const QString &iconName, co setToolTip(tooltip); setPopupMode(QToolButton::MenuButtonPopup); - connect(this, &ColorToolButton::clicked, this, [this]() { + connect(this, &ColorToolButton::clicked, this, [this] { setCurrentColor(m_color); }); diff --git a/src/plugins/scxmleditor/common/mainwidget.cpp b/src/plugins/scxmleditor/common/mainwidget.cpp index b06c0db563d..c83aaa78ed7 100644 --- a/src/plugins/scxmleditor/common/mainwidget.cpp +++ b/src/plugins/scxmleditor/common/mainwidget.cpp @@ -216,19 +216,19 @@ void MainWidget::init() view->scene()->unhighlightAll(); }); - connect(m_errorPane, &ErrorWidget::warningEntered, [this](Warning *w) { + connect(m_errorPane, &ErrorWidget::warningEntered, this, [this](Warning *w) { StateView *view = m_views.last(); if (view) view->scene()->highlightWarningItem(w); }); - connect(m_errorPane, &ErrorWidget::warningSelected, [this](Warning *w) { + connect(m_errorPane, &ErrorWidget::warningSelected, this, [this](Warning *w) { StateView *view = m_views.last(); if (view) view->scene()->selectWarningItem(w); }); - connect(m_errorPane, &ErrorWidget::warningDoubleClicked, [this](Warning *w) { + connect(m_errorPane, &ErrorWidget::warningDoubleClicked, this, [this](Warning *w) { StateView *view = m_views.last(); if (view) view->view()->zoomToItem(view->scene()->findItem(view->scene()->tagByWarning(w))); @@ -333,14 +333,14 @@ void MainWidget::init() QToolButton *adjustToolButton = createToolButton(toolButtonIcon(ActionAdjustWidth), Tr::tr("Adjust Width"), QToolButton::MenuButtonPopup); // Connect state color change - connect(stateColorButton, &ColorToolButton::colorSelected, [this](const QString &color) { + connect(stateColorButton, &ColorToolButton::colorSelected, this, [this](const QString &color) { StateView *view = m_views.last(); if (view) view->scene()->setEditorInfo(Constants::C_SCXML_EDITORINFO_STATECOLOR, color); }); // Connect font color change - connect(fontColorButton, &ColorToolButton::colorSelected, [this](const QString &color) { + connect(fontColorButton, &ColorToolButton::colorSelected, this, [this](const QString &color) { StateView *view = m_views.last(); if (view) view->scene()->setEditorInfo(Constants::C_SCXML_EDITORINFO_FONTCOLOR, color); diff --git a/src/plugins/scxmleditor/common/shapegroupwidget.cpp b/src/plugins/scxmleditor/common/shapegroupwidget.cpp index 52c556c7795..c703389454d 100644 --- a/src/plugins/scxmleditor/common/shapegroupwidget.cpp +++ b/src/plugins/scxmleditor/common/shapegroupwidget.cpp @@ -30,7 +30,7 @@ ShapeGroupWidget::ShapeGroupWidget(ShapeProvider *shapeProvider, int groupIndex, m_content->layout()->addWidget(button); } - connect(m_closeButton, &QToolButton::clicked, this, [this]() { + connect(m_closeButton, &QToolButton::clicked, this, [this] { m_content->setVisible(!m_content->isVisible()); m_closeButton->setIcon(m_content->isVisible() ? Utils::Icons::COLLAPSE_TOOLBAR.icon() diff --git a/src/plugins/scxmleditor/outputpane/errorwidget.cpp b/src/plugins/scxmleditor/outputpane/errorwidget.cpp index 2afe224235b..7a7234ad46f 100644 --- a/src/plugins/scxmleditor/outputpane/errorwidget.cpp +++ b/src/plugins/scxmleditor/outputpane/errorwidget.cpp @@ -37,34 +37,34 @@ ErrorWidget::ErrorWidget(QWidget *parent) m_errorsTable->setModel(m_proxyModel); - connect(m_errorsTable, &TableView::entered, [this](const QModelIndex &ind) { + connect(m_errorsTable, &TableView::entered, this, [this](const QModelIndex &ind) { if (ind.isValid()) emit warningEntered(m_warningModel->getWarning(m_proxyModel->mapToSource(ind))); }); - connect(m_errorsTable, &TableView::pressed, [this](const QModelIndex &ind) { + connect(m_errorsTable, &TableView::pressed, this, [this](const QModelIndex &ind) { if (ind.isValid()) emit warningSelected(m_warningModel->getWarning(m_proxyModel->mapToSource(ind))); }); - connect(m_errorsTable, &TableView::doubleClicked, [this](const QModelIndex &ind) { + connect(m_errorsTable, &TableView::doubleClicked, this, [this](const QModelIndex &ind) { if (ind.isValid()) emit warningDoubleClicked(m_warningModel->getWarning(m_proxyModel->mapToSource(ind))); }); - connect(m_errorsTable, &TableView::mouseExited, this, [this](){ + connect(m_errorsTable, &TableView::mouseExited, this, [this] { emit mouseExited(); }); - connect(m_showErrors, &QToolButton::toggled, [this](bool show) { + connect(m_showErrors, &QToolButton::toggled, this, [this](bool show) { m_warningModel->setShowWarnings(Warning::ErrorType, show); }); - connect(m_showWarnings, &QToolButton::toggled, [this](bool show) { + connect(m_showWarnings, &QToolButton::toggled, this, [this](bool show) { m_warningModel->setShowWarnings(Warning::WarningType, show); }); - connect(m_showInfos, &QToolButton::toggled, [this](bool show) { + connect(m_showInfos, &QToolButton::toggled, this, [this](bool show) { m_warningModel->setShowWarnings(Warning::InfoType, show); }); diff --git a/src/plugins/scxmleditor/outputpane/warningmodel.cpp b/src/plugins/scxmleditor/outputpane/warningmodel.cpp index 3339af067db..9420cd5afc8 100644 --- a/src/plugins/scxmleditor/outputpane/warningmodel.cpp +++ b/src/plugins/scxmleditor/outputpane/warningmodel.cpp @@ -17,7 +17,7 @@ WarningModel::WarningModel(QObject *parent) m_countChecker = new QTimer(this); m_countChecker->setInterval(500); m_countChecker->setSingleShot(true); - connect(m_countChecker.data(), &QTimer::timeout, this, [this]() { + connect(m_countChecker.data(), &QTimer::timeout, this, [this] { if (m_warnings.count() != m_oldCount) { m_oldCount = m_warnings.count(); emit countChanged(m_oldCount); diff --git a/src/plugins/scxmleditor/plugin_interface/tagtextitem.cpp b/src/plugins/scxmleditor/plugin_interface/tagtextitem.cpp index 1114703b3a8..feef3317c4b 100644 --- a/src/plugins/scxmleditor/plugin_interface/tagtextitem.cpp +++ b/src/plugins/scxmleditor/plugin_interface/tagtextitem.cpp @@ -17,15 +17,10 @@ TagTextItem::TagTextItem(QGraphicsItem *parent) setFlag(ItemIsFocusable, true); setFlag(ItemIsSelectable, true); m_textItem = new TextItem(this); - connect(m_textItem, &TextItem::textChanged, this, [=](){ - emit textChanged(); - }); - connect(m_textItem, &TextItem::textReady, this, [=](const QString &text){ - emit textReady(text); - }); - connect(m_textItem, &TextItem::selected, this, [=](bool sel){ - emit selected(sel); - }); + connect(m_textItem, &TextItem::textChanged, this, [this] { emit textChanged(); }); + connect(m_textItem, &TextItem::textReady, + this, [this](const QString &text) { emit textReady(text); }); + connect(m_textItem, &TextItem::selected, this, [this](bool sel) { emit selected(sel); }); setAcceptHoverEvents(true); } diff --git a/src/plugins/scxmleditor/scxmleditordata.cpp b/src/plugins/scxmleditor/scxmleditordata.cpp index 6ca861131be..c9a7726d83f 100644 --- a/src/plugins/scxmleditor/scxmleditordata.cpp +++ b/src/plugins/scxmleditor/scxmleditordata.cpp @@ -53,15 +53,15 @@ public: ScxmlTextEditorFactory() { setId(ScxmlEditor::Constants::K_SCXML_EDITOR_ID); - setEditorCreator([]() { return new ScxmlTextEditor; }); - setEditorWidgetCreator([]() { return new ScxmlTextEditorWidget; }); + setEditorCreator([] { return new ScxmlTextEditor; }); + setEditorWidgetCreator([] { return new ScxmlTextEditorWidget; }); setUseGenericHighlighter(true); setDuplicatedSupported(false); } ScxmlTextEditor *create(ScxmlEditor::Common::MainWidget *designWidget) { - setDocumentCreator([designWidget]() { return new ScxmlEditorDocument(designWidget); }); + setDocumentCreator([designWidget] { return new ScxmlEditorDocument(designWidget); }); return qobject_cast(createEditor()); } }; @@ -70,7 +70,8 @@ ScxmlEditorData::ScxmlEditorData() { m_contexts.add(ScxmlEditor::Constants::C_SCXMLEDITOR); - QObject::connect(EditorManager::instance(), &EditorManager::currentEditorChanged, [this](IEditor *editor) { + QObject::connect(EditorManager::instance(), &EditorManager::currentEditorChanged, + this, [this](IEditor *editor) { if (editor && editor->document()->id() == Constants::K_SCXML_EDITOR_ID) { auto xmlEditor = qobject_cast(editor); QTC_ASSERT(xmlEditor, return ); @@ -142,7 +143,8 @@ IEditor *ScxmlEditorData::createEditor() if (xmlEditor) { Utils::InfoBarEntry info(Id(Constants::INFO_READ_ONLY), Tr::tr("This file can only be edited in Design mode.")); - info.addCustomButton(Tr::tr("Switch Mode"), []() { ModeManager::activateMode(Core::Constants::MODE_DESIGN); }); + info.addCustomButton(Tr::tr("Switch Mode"), + [] { ModeManager::activateMode(Core::Constants::MODE_DESIGN); }); xmlEditor->document()->infoBar()->addInfo(info); } diff --git a/src/plugins/scxmleditor/scxmltexteditor.cpp b/src/plugins/scxmleditor/scxmltexteditor.cpp index 5aba886d0e5..9c1b492afa0 100644 --- a/src/plugins/scxmleditor/scxmltexteditor.cpp +++ b/src/plugins/scxmleditor/scxmltexteditor.cpp @@ -29,9 +29,9 @@ void ScxmlTextEditor::finalizeInitialization() // Revert to saved/load externally modified files. auto document = qobject_cast(textDocument()); connect(document, &ScxmlEditorDocument::reloadRequested, - [this](QString *errorString, const QString &fileName) { - open(errorString, fileName, fileName); - }); + this, [this](QString *errorString, const QString &fileName) { + open(errorString, fileName, fileName); + }); } bool ScxmlTextEditor::open(QString *errorString, const QString &fileName, const QString & /*realFileName*/)