Clean up some lambdas

Change-Id: Id947c0935b1aa4579e1c64d3e510db41103fbe27
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2023-12-12 11:34:17 +01:00
parent 8d2cee31e4
commit 016936a450
106 changed files with 237 additions and 241 deletions

View File

@@ -103,7 +103,7 @@ struct AutoHideTabPrivate
AbstractFloatingWidget *createFloatingWidget(T *widget) AbstractFloatingWidget *createFloatingWidget(T *widget)
{ {
auto w = new FloatingDragPreview(widget); auto w = new FloatingDragPreview(widget);
q->connect(w, &FloatingDragPreview::draggingCanceled, [=]() { q->connect(w, &FloatingDragPreview::draggingCanceled, [this] {
m_dragState = DraggingInactive; m_dragState = DraggingInactive;
}); });
return w; return w;

View File

@@ -321,7 +321,7 @@ DockContainerWidgetPrivate::DockContainerWidgetPrivate(DockContainerWidget *pare
std::fill(std::begin(m_lastAddedAreaCache), std::end(m_lastAddedAreaCache), nullptr); std::fill(std::begin(m_lastAddedAreaCache), std::end(m_lastAddedAreaCache), nullptr);
m_delayedAutoHideTimer.setSingleShot(true); m_delayedAutoHideTimer.setSingleShot(true);
m_delayedAutoHideTimer.setInterval(500); m_delayedAutoHideTimer.setInterval(500);
QObject::connect(&m_delayedAutoHideTimer, &QTimer::timeout, q, [this]() { QObject::connect(&m_delayedAutoHideTimer, &QTimer::timeout, q, [this] {
auto globalPos = m_delayedAutoHideTab->mapToGlobal(QPoint(0, 0)); auto globalPos = m_delayedAutoHideTab->mapToGlobal(QPoint(0, 0));
qApp->sendEvent(m_delayedAutoHideTab, qApp->sendEvent(m_delayedAutoHideTab,
new QMouseEvent(QEvent::MouseButtonPress, new QMouseEvent(QEvent::MouseButtonPress,

View File

@@ -333,7 +333,7 @@ DockManager::DockManager(QWidget *parent)
: DockContainerWidget(this, parent) : DockContainerWidget(this, parent)
, d(new DockManagerPrivate(this)) , d(new DockManagerPrivate(this))
{ {
connect(this, &DockManager::workspaceListChanged, this, [=] { connect(this, &DockManager::workspaceListChanged, this, [this] {
d->m_workspaceOrderDirty = true; d->m_workspaceOrderDirty = true;
}); });

View File

@@ -105,7 +105,7 @@ public:
return new FloatingDockContainer(widget); return new FloatingDockContainer(widget);
} else { } else {
auto w = new FloatingDragPreview(widget); auto w = new FloatingDragPreview(widget);
QObject::connect(w, &FloatingDragPreview::draggingCanceled, q, [=]() { QObject::connect(w, &FloatingDragPreview::draggingCanceled, q, [this] {
m_dragState = DraggingInactive; m_dragState = DraggingInactive;
}); });
return w; return w;

View File

@@ -85,7 +85,7 @@ void AnnotationItem::update()
m_textItem->setTextInteractionFlags(Qt::TextEditorInteraction); m_textItem->setTextInteractionFlags(Qt::TextEditorInteraction);
m_textItem->installSceneEventFilter(this); m_textItem->installSceneEventFilter(this);
QObject::connect(m_textItem->document(), &QTextDocument::contentsChanged, m_textItem, QObject::connect(m_textItem->document(), &QTextDocument::contentsChanged, m_textItem,
[=]() { this->onContentsChanged(); } ); [this] { this->onContentsChanged(); } );
} }
m_textItem->setFont(style->normalFont()); m_textItem->setFont(style->normalFont());
m_textItem->setDefaultTextColor(style->textBrush().color()); m_textItem->setDefaultTextColor(style->textBrush().color());

View File

@@ -87,7 +87,7 @@ void BoundaryItem::update()
m_textItem->setTextInteractionFlags(Qt::TextEditorInteraction); m_textItem->setTextInteractionFlags(Qt::TextEditorInteraction);
m_textItem->installSceneEventFilter(this); m_textItem->installSceneEventFilter(this);
QObject::connect(m_textItem->document(), &QTextDocument::contentsChanged, m_textItem, QObject::connect(m_textItem->document(), &QTextDocument::contentsChanged, m_textItem,
[=]() { this->onContentsChanged(); } ); [this] { this->onContentsChanged(); } );
} }
m_textItem->setFont(style->normalFont()); m_textItem->setFont(style->normalFont());
m_textItem->setDefaultTextColor(style->textBrush().color()); m_textItem->setDefaultTextColor(style->textBrush().color());

View File

@@ -574,14 +574,13 @@ void ObjectItem::updateNameItem(const Style *style)
textOption.setAlignment(Qt::AlignHCenter); textOption.setAlignment(Qt::AlignHCenter);
m_nameItem->document()->setDefaultTextOption(textOption); m_nameItem->document()->setDefaultTextOption(textOption);
QObject::connect(m_nameItem->document(), &QTextDocument::contentsChanged, m_nameItem, QObject::connect(m_nameItem->document(), &QTextDocument::contentsChanged, m_nameItem,
[=]() [this] {
{
this->m_nameItem->setTextWidth(-1); this->m_nameItem->setTextWidth(-1);
this->m_nameItem->setTextWidth(m_nameItem->boundingRect().width()); this->m_nameItem->setTextWidth(m_nameItem->boundingRect().width());
this->setFromDisplayName(m_nameItem->toPlainText()); this->setFromDisplayName(m_nameItem->toPlainText());
}); });
QObject::connect(m_nameItem, &EditableTextItem::returnKeyPressed, m_nameItem, QObject::connect(m_nameItem, &EditableTextItem::returnKeyPressed, m_nameItem,
[=]() { this->m_nameItem->clearFocus(); }); [this] { this->m_nameItem->clearFocus(); });
} }
if (style->headerFont() != m_nameItem->font()) if (style->headerFont() != m_nameItem->font())
m_nameItem->setFont(style->headerFont()); m_nameItem->setFont(style->headerFont());

View File

@@ -119,7 +119,7 @@ TerminalView::TerminalView(QWidget *parent)
setupSurface(); setupSurface();
setFont(QFont(defaultFontFamily(), defaultFontSize())); setFont(QFont(defaultFontFamily(), defaultFontSize()));
connect(&d->m_cursorBlinkTimer, &QTimer::timeout, this, [this]() { connect(&d->m_cursorBlinkTimer, &QTimer::timeout, this, [this] {
if (hasFocus()) if (hasFocus())
d->m_cursorBlinkState = !d->m_cursorBlinkState; d->m_cursorBlinkState = !d->m_cursorBlinkState;
else else
@@ -140,7 +140,7 @@ TerminalView::TerminalView(QWidget *parent)
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
connect(&d->m_flushDelayTimer, &QTimer::timeout, this, [this]() { flushVTerm(true); }); connect(&d->m_flushDelayTimer, &QTimer::timeout, this, [this] { flushVTerm(true); });
connect(&d->m_scrollTimer, &QTimer::timeout, this, [this] { connect(&d->m_scrollTimer, &QTimer::timeout, this, [this] {
if (d->m_scrollDirection < 0) if (d->m_scrollDirection < 0)

View File

@@ -178,7 +178,7 @@ TimelineModel::TimelineModel(TimelineModelAggregator *parent) :
connect(this, &TimelineModel::expandedChanged, this, &TimelineModel::rowCountChanged); connect(this, &TimelineModel::expandedChanged, this, &TimelineModel::rowCountChanged);
connect(this, &TimelineModel::contentChanged, this, &TimelineModel::rowCountChanged); connect(this, &TimelineModel::contentChanged, this, &TimelineModel::rowCountChanged);
connect(this, &TimelineModel::contentChanged, connect(this, &TimelineModel::contentChanged,
this, [this]() { emit expandedRowHeightChanged(-1, -1); }); this, [this] { emit expandedRowHeightChanged(-1, -1); });
} }
TimelineModel::~TimelineModel() TimelineModel::~TimelineModel()

View File

@@ -60,7 +60,7 @@ private:
TextEditor::GenericProposal *handleCodeActionResult(const CodeActionResult &result) override TextEditor::GenericProposal *handleCodeActionResult(const CodeActionResult &result) override
{ {
auto toOperation = auto toOperation =
[=](const std::variant<Command, CodeAction> &item) -> QuickFixOperation * { [this](const std::variant<Command, CodeAction> &item) -> QuickFixOperation * {
if (auto action = std::get_if<CodeAction>(&item)) { if (auto action = std::get_if<CodeAction>(&item)) {
const std::optional<QList<Diagnostic>> diagnostics = action->diagnostics(); const std::optional<QList<Diagnostic>> diagnostics = action->diagnostics();
if (!diagnostics.has_value() || diagnostics->isEmpty()) if (!diagnostics.has_value() || diagnostics->isEmpty())

View File

@@ -281,7 +281,7 @@ void Manager::initialize()
d->m_timer.start(400); // Accumulate multiple requests into one, restarts the timer d->m_timer.start(400); // Accumulate multiple requests into one, restarts the timer
}); });
connect(&d->m_timer, &QTimer::timeout, this, [this]() { connect(&d->m_timer, &QTimer::timeout, this, [this] {
const QSet<FilePath> docsToBeUpdated = d->m_awaitingDocuments; const QSet<FilePath> docsToBeUpdated = d->m_awaitingDocuments;
d->cancelScheduledUpdate(); d->cancelScheduledUpdate();
if (!state() || d->disableCodeParser) // enabling any of them will trigger the total update if (!state() || d->disableCodeParser) // enabling any of them will trigger the total update

View File

@@ -96,7 +96,7 @@ void CocoPlugin::initialize()
Command *cmd = ActionManager::registerAction(startCoco, "Coco.startCoco"); Command *cmd = ActionManager::registerAction(startCoco, "Coco.startCoco");
menu->addAction(cmd, Debugger::Constants::G_ANALYZER_TOOLS); menu->addAction(cmd, Debugger::Constants::G_ANALYZER_TOOLS);
connect(startCoco, &QAction::triggered, this, [this]() { d->startCoco(); }); connect(startCoco, &QAction::triggered, this, [this] { d->startCoco(); });
} }
} }

View File

@@ -560,7 +560,7 @@ void EditorWidget::addCompiler(const std::shared_ptr<SourceSettings> &sourceSett
sourceSettings->compilers.removeItem(compilerSettings->shared_from_this()); sourceSettings->compilers.removeItem(compilerSettings->shared_from_this());
}); });
connect(compiler, &CompilerWidget::gotFocus, this, [this]() { connect(compiler, &CompilerWidget::gotFocus, this, [this] {
m_actionHandler.updateCurrentEditor(); m_actionHandler.updateCurrentEditor();
}); });
} }
@@ -600,7 +600,7 @@ void EditorWidget::addSourceEditor(const std::shared_ptr<SourceSettings> &source
setupHelpWidget(); setupHelpWidget();
}); });
connect(sourceEditor, &SourceEditorWidget::gotFocus, this, [this]() { connect(sourceEditor, &SourceEditorWidget::gotFocus, this, [this] {
m_actionHandler.updateCurrentEditor(); m_actionHandler.updateCurrentEditor();
}); });

View File

@@ -91,7 +91,7 @@ public:
m_timer = new QTimer(this); m_timer = new QTimer(this);
m_timer->setInterval(100); m_timer->setInterval(100);
connect(m_timer, &QTimer::timeout, this, [this]() { connect(m_timer, &QTimer::timeout, this, [this] {
m_socket.connectToHost(m_hostName, m_port); m_socket.connectToHost(m_hostName, m_port);
m_socket.waitForConnected(); m_socket.waitForConnected();

View File

@@ -253,12 +253,12 @@ void AttachCoreDialog::accepted()
AsyncTask<ResultType>{[this, copyFileAsync](auto &task) { AsyncTask<ResultType>{[this, copyFileAsync](auto &task) {
task.setConcurrentCallData(copyFileAsync, coreFile()); task.setConcurrentCallData(copyFileAsync, coreFile());
}, },
[=](const Async<ResultType> &task) { d->coreFileResult = task.result(); }, [this](const Async<ResultType> &task) { d->coreFileResult = task.result(); },
CallDoneIf::Success}, CallDoneIf::Success},
AsyncTask<ResultType>{[this, copyFileAsync](auto &task) { AsyncTask<ResultType>{[this, copyFileAsync](auto &task) {
task.setConcurrentCallData(copyFileAsync, symbolFile()); task.setConcurrentCallData(copyFileAsync, symbolFile());
}, },
[=](const Async<ResultType> &task) { d->symbolFileResult = task.result(); }, [this](const Async<ResultType> &task) { d->symbolFileResult = task.result(); },
CallDoneIf::Success} CallDoneIf::Success}
}; };

View File

@@ -103,7 +103,7 @@ GitLabCloneDialog::GitLabCloneDialog(const Project &project, QWidget *parent)
connect(m_cloneButton, &QPushButton::clicked, this, &GitLabCloneDialog::cloneProject); connect(m_cloneButton, &QPushButton::clicked, this, &GitLabCloneDialog::cloneProject);
connect(m_cancelButton, &QPushButton::clicked, connect(m_cancelButton, &QPushButton::clicked,
this, &GitLabCloneDialog::cancel); this, &GitLabCloneDialog::cancel);
connect(this, &QDialog::rejected, this, [this]() { connect(this, &QDialog::rejected, this, [this] {
if (m_commandRunning) { if (m_commandRunning) {
cancel(); cancel();
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();

View File

@@ -167,8 +167,7 @@ GlslEditorWidget::GlslEditorWidget()
connect(&m_updateDocumentTimer, &QTimer::timeout, connect(&m_updateDocumentTimer, &QTimer::timeout,
this, &GlslEditorWidget::updateDocumentNow); this, &GlslEditorWidget::updateDocumentNow);
connect(this, &QPlainTextEdit::textChanged, connect(this, &QPlainTextEdit::textChanged, [this] { m_updateDocumentTimer.start(); });
[this]() { m_updateDocumentTimer.start(); });
m_outlineCombo = new QComboBox; m_outlineCombo = new QComboBox;
m_outlineCombo->setMinimumContentsLength(22); m_outlineCombo->setMinimumContentsLength(22);

View File

@@ -204,7 +204,7 @@ DocSettingsPageWidget::DocSettingsPageWidget()
&QSortFilterProxyModel::setFilterFixedString); &QSortFilterProxyModel::setFilterFixedString);
connect(addButton, &QAbstractButton::clicked, this, &DocSettingsPageWidget::addDocumentation); connect(addButton, &QAbstractButton::clicked, this, &DocSettingsPageWidget::addDocumentation);
connect(removeButton, &QAbstractButton::clicked, this, [this]() { connect(removeButton, &QAbstractButton::clicked, this, [this] {
removeDocumentation(currentSelection()); removeDocumentation(currentSelection());
}); });

View File

@@ -240,7 +240,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
addSideBar(); addSideBar();
m_toggleSideBarAction->setChecked(m_sideBar->isVisibleTo(this)); m_toggleSideBarAction->setChecked(m_sideBar->isVisibleTo(this));
connect(m_toggleSideBarAction, &QAction::triggered, m_sideBar, &Core::SideBar::setVisible); connect(m_toggleSideBarAction, &QAction::triggered, m_sideBar, &Core::SideBar::setVisible);
connect(m_sideBar, &Core::SideBar::sideBarClosed, m_toggleSideBarAction, [this]() { connect(m_sideBar, &Core::SideBar::sideBarClosed, m_toggleSideBarAction, [this] {
m_toggleSideBarAction->setChecked(false); m_toggleSideBarAction->setChecked(false);
}); });
if (style == ExternalWindow) { if (style == ExternalWindow) {
@@ -386,7 +386,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
m_printAction = new QAction(this); m_printAction = new QAction(this);
Core::ActionManager::registerAction(m_printAction, Core::Constants::PRINT, context); Core::ActionManager::registerAction(m_printAction, Core::Constants::PRINT, context);
connect(m_printAction, &QAction::triggered, this, [this]() { print(currentViewer()); }); connect(m_printAction, &QAction::triggered, this, [this] { print(currentViewer()); });
m_copy = new QAction(this); m_copy = new QAction(this);
Core::ActionManager::registerAction(m_copy, Core::Constants::COPY, context); Core::ActionManager::registerAction(m_copy, Core::Constants::COPY, context);
@@ -426,20 +426,20 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
openMenu->addAction(m_switchToHelp); openMenu->addAction(m_switchToHelp);
if (style != SideBarWidget) { if (style != SideBarWidget) {
QAction *openSideBySide = openMenu->addAction(Tr::tr("Open in Edit Mode")); QAction *openSideBySide = openMenu->addAction(Tr::tr("Open in Edit Mode"));
connect(openSideBySide, &QAction::triggered, this, [this]() { connect(openSideBySide, &QAction::triggered, this, [this] {
postRequestShowHelpUrl(Core::HelpManager::SideBySideAlways); postRequestShowHelpUrl(Core::HelpManager::SideBySideAlways);
}); });
} }
if (supportsPages()) { if (supportsPages()) {
QAction *openPage = openMenu->addAction(Tr::tr("Open in New Page")); QAction *openPage = openMenu->addAction(Tr::tr("Open in New Page"));
connect(openPage, &QAction::triggered, this, [this]() { connect(openPage, &QAction::triggered, this, [this] {
if (HelpViewer *viewer = currentViewer()) if (HelpViewer *viewer = currentViewer())
openNewPage(viewer->source()); openNewPage(viewer->source());
}); });
} }
if (style != ExternalWindow) { if (style != ExternalWindow) {
QAction *openExternal = openMenu->addAction(Tr::tr("Open in Window")); QAction *openExternal = openMenu->addAction(Tr::tr("Open in Window"));
connect(openExternal, &QAction::triggered, this, [this]() { connect(openExternal, &QAction::triggered, this, [this] {
postRequestShowHelpUrl(Core::HelpManager::ExternalHelpAlways); postRequestShowHelpUrl(Core::HelpManager::ExternalHelpAlways);
}); });
} }
@@ -458,7 +458,7 @@ HelpWidget::HelpWidget(const Core::Context &context, WidgetStyle style, QWidget
layout->addWidget(button); layout->addWidget(button);
QAction *reload = openMenu->addAction(Tr::tr("Reload")); QAction *reload = openMenu->addAction(Tr::tr("Reload"));
connect(reload, &QAction::triggered, this, [this]() { connect(reload, &QAction::triggered, this, [this] {
const int index = m_viewerStack->currentIndex(); const int index = m_viewerStack->currentIndex();
HelpViewer *previous = currentViewer(); HelpViewer *previous = currentViewer();
insertViewer(index, previous->source()); insertViewer(index, previous->source());
@@ -621,20 +621,20 @@ void HelpWidget::addSideBar()
m_sideBar->readSettings(Core::ICore::settings(), sideBarSettingsKey()); m_sideBar->readSettings(Core::ICore::settings(), sideBarSettingsKey());
m_sideBarSplitter->setSizes(QList<int>() << m_sideBar->size().width() << 300); m_sideBarSplitter->setSizes(QList<int>() << m_sideBar->size().width() << 300);
connect(m_contentsAction, &QAction::triggered, m_sideBar, [this]() { connect(m_contentsAction, &QAction::triggered, m_sideBar, [this] {
m_sideBar->activateItem(Constants::HELP_CONTENTS); m_sideBar->activateItem(Constants::HELP_CONTENTS);
}); });
connect(m_indexAction, &QAction::triggered, m_sideBar, [this]() { connect(m_indexAction, &QAction::triggered, m_sideBar, [this] {
m_sideBar->activateItem(Constants::HELP_INDEX); m_sideBar->activateItem(Constants::HELP_INDEX);
}); });
connect(m_bookmarkAction, &QAction::triggered, m_sideBar, [this]() { connect(m_bookmarkAction, &QAction::triggered, m_sideBar, [this] {
m_sideBar->activateItem(Constants::HELP_BOOKMARKS); m_sideBar->activateItem(Constants::HELP_BOOKMARKS);
}); });
connect(m_searchAction, &QAction::triggered, m_sideBar, [this]() { connect(m_searchAction, &QAction::triggered, m_sideBar, [this] {
m_sideBar->activateItem(Constants::HELP_SEARCH); m_sideBar->activateItem(Constants::HELP_SEARCH);
}); });
if (m_openPagesAction) { if (m_openPagesAction) {
connect(m_openPagesAction, &QAction::triggered, m_sideBar, [this]() { connect(m_openPagesAction, &QAction::triggered, m_sideBar, [this] {
m_sideBar->activateItem(Constants::HELP_OPENPAGES); m_sideBar->activateItem(Constants::HELP_OPENPAGES);
}); });
} }

View File

@@ -166,7 +166,7 @@ public:
connect(m_clientInterface, &InterfaceController::messageReceived, q, &Client::handleMessage); connect(m_clientInterface, &InterfaceController::messageReceived, q, &Client::handleMessage);
connect(m_clientInterface, &InterfaceController::error, q, &Client::setError); connect(m_clientInterface, &InterfaceController::error, q, &Client::setError);
connect(m_clientInterface, &InterfaceController::finished, q, &Client::finished); connect(m_clientInterface, &InterfaceController::finished, q, &Client::finished);
connect(m_clientInterface, &InterfaceController::started, this, [this]() { connect(m_clientInterface, &InterfaceController::started, this, [this] {
LanguageClientManager::clientStarted(q); LanguageClientManager::clientStarted(q);
}); });
connect(Core::EditorManager::instance(), connect(Core::EditorManager::instance(),
@@ -1479,7 +1479,7 @@ void Client::setCurrentProject(ProjectExplorer::Project *project)
d->m_project->disconnect(this); d->m_project->disconnect(this);
d->m_project = project; d->m_project = project;
if (d->m_project) { if (d->m_project) {
connect(d->m_project, &ProjectExplorer::Project::destroyed, this, [this]() { connect(d->m_project, &ProjectExplorer::Project::destroyed, this, [this] {
// the project of the client should already be null since we expect the session and // the project of the client should already be null since we expect the session and
// the language client manager to reset it before it gets deleted. // the language client manager to reset it before it gets deleted.
QTC_ASSERT(d->m_project == nullptr, projectClosed(d->m_project)); QTC_ASSERT(d->m_project == nullptr, projectClosed(d->m_project));

View File

@@ -24,7 +24,7 @@ LanguageClientFormatter::LanguageClientFormatter(TextEditor::TextDocument *docum
{ {
m_cancelConnection = QObject::connect(document->document(), m_cancelConnection = QObject::connect(document->document(),
&QTextDocument::contentsChanged, &QTextDocument::contentsChanged,
[this]() { [this] {
if (m_ignoreCancel) if (m_ignoreCancel)
m_ignoreCancel = false; m_ignoreCancel = false;
else else
@@ -93,7 +93,7 @@ QFutureWatcher<ChangeSet> *LanguageClientFormatter::format(
m_ignoreCancel = true; m_ignoreCancel = true;
m_progress.reportStarted(); m_progress.reportStarted();
auto watcher = new QFutureWatcher<ChangeSet>(); auto watcher = new QFutureWatcher<ChangeSet>();
QObject::connect(watcher, &QFutureWatcher<ChangeSet>::canceled, [this]() { QObject::connect(watcher, &QFutureWatcher<ChangeSet>::canceled, [this] {
cancelCurrentRequest(); cancelCurrentRequest();
}); });
watcher->setFuture(m_progress.future()); watcher->setFuture(m_progress.future());

View File

@@ -31,7 +31,7 @@ SemanticTokenSupport::SemanticTokenSupport(Client *client)
QObject::connect(TextEditorSettings::instance(), QObject::connect(TextEditorSettings::instance(),
&TextEditorSettings::fontSettingsChanged, &TextEditorSettings::fontSettingsChanged,
client, client,
[this]() { updateFormatHash(); }); [this] { updateFormatHash(); });
QObject::connect(Core::EditorManager::instance(), QObject::connect(Core::EditorManager::instance(),
&Core::EditorManager::currentEditorChanged, &Core::EditorManager::currentEditorChanged,
this, this,

View File

@@ -212,7 +212,7 @@ void McuSupportPlugin::extensionsInitialized()
{ {
ProjectExplorer::DeviceManager::instance()->addDevice(McuSupportDevice::create()); ProjectExplorer::DeviceManager::instance()->addDevice(McuSupportDevice::create());
connect(KitManager::instance(), &KitManager::kitsLoaded, [this]() { connect(KitManager::instance(), &KitManager::kitsLoaded, [this] {
McuKitManager::removeOutdatedKits(); McuKitManager::removeOutdatedKits();
McuKitManager::createAutomaticKits(dd->m_settingsHandler); McuKitManager::createAutomaticKits(dd->m_settingsHandler);
McuKitManager::fixExistingKits(dd->m_settingsHandler); McuKitManager::fixExistingKits(dd->m_settingsHandler);

View File

@@ -96,7 +96,7 @@ void ToolKitAspectWidget::loadTools()
void ToolKitAspectWidget::setToDefault() void ToolKitAspectWidget::setToDefault()
{ {
const MesonTools::Tool_t autoDetected = [this]() { const MesonTools::Tool_t autoDetected = [this] {
if (m_type == ToolType::Meson) if (m_type == ToolType::Meson)
return std::dynamic_pointer_cast<ToolWrapper>(MesonTools::mesonWrapper()); return std::dynamic_pointer_cast<ToolWrapper>(MesonTools::mesonWrapper());
return std::dynamic_pointer_cast<ToolWrapper>(MesonTools::ninjaWrapper()); return std::dynamic_pointer_cast<ToolWrapper>(MesonTools::ninjaWrapper());

View File

@@ -44,7 +44,7 @@ private:
void refresh() override void refresh() override
{ {
const auto id = [this]() { const auto id = [this] {
if (m_type == ToolType::Meson) if (m_type == ToolType::Meson)
return MesonToolKitAspect::mesonToolId(m_kit); return MesonToolKitAspect::mesonToolId(m_kit);
return NinjaToolKitAspect::ninjaToolId(m_kit); return NinjaToolKitAspect::ninjaToolId(m_kit);

View File

@@ -307,25 +307,25 @@ void ModelEditor::init()
toolbarLayout->addStretch(1); toolbarLayout->addStretch(1);
toolbarLayout->addWidget(createToolbarCommandButton(Core::Constants::ZOOM_RESET, toolbarLayout->addWidget(createToolbarCommandButton(Core::Constants::ZOOM_RESET,
[this]() { resetZoom(); }, [this] { resetZoom(); },
d->toolbar)); d->toolbar));
toolbarLayout->addWidget(createToolbarCommandButton(Core::Constants::ZOOM_IN, toolbarLayout->addWidget(createToolbarCommandButton(Core::Constants::ZOOM_IN,
[this]() { zoomIn(); }, [this] { zoomIn(); },
d->toolbar)); d->toolbar));
toolbarLayout->addWidget(createToolbarCommandButton(Core::Constants::ZOOM_OUT, toolbarLayout->addWidget(createToolbarCommandButton(Core::Constants::ZOOM_OUT,
[this]() { zoomOut(); }, [this] { zoomOut(); },
d->toolbar)); d->toolbar));
toolbarLayout->addWidget(createToolbarCommandButton(Constants::ACTION_ADD_PACKAGE, toolbarLayout->addWidget(createToolbarCommandButton(Constants::ACTION_ADD_PACKAGE,
[this]() { onAddPackage(); }, [this] { onAddPackage(); },
d->toolbar)); d->toolbar));
toolbarLayout->addWidget(createToolbarCommandButton(Constants::ACTION_ADD_COMPONENT, toolbarLayout->addWidget(createToolbarCommandButton(Constants::ACTION_ADD_COMPONENT,
[this]() { onAddComponent(); }, [this] { onAddComponent(); },
d->toolbar)); d->toolbar));
toolbarLayout->addWidget(createToolbarCommandButton(Constants::ACTION_ADD_CLASS, toolbarLayout->addWidget(createToolbarCommandButton(Constants::ACTION_ADD_CLASS,
[this]() { onAddClass(); }, [this] { onAddClass(); },
d->toolbar)); d->toolbar));
toolbarLayout->addWidget(createToolbarCommandButton(Constants::ACTION_ADD_CANVAS_DIAGRAM, toolbarLayout->addWidget(createToolbarCommandButton(Constants::ACTION_ADD_CANVAS_DIAGRAM,
[this]() { onAddCanvasDiagram(); }, [this] { onAddCanvasDiagram(); },
d->toolbar)); d->toolbar));
toolbarLayout->addSpacing(20); toolbarLayout->addSpacing(20);
@@ -871,7 +871,7 @@ void ModelEditor::onAddPackage()
qmt::MPackage *package = documentController->createNewPackage(d->modelTreeViewServant->selectedPackage()); qmt::MPackage *package = documentController->createNewPackage(d->modelTreeViewServant->selectedPackage());
d->modelTreeView->selectFromSourceModelIndex(documentController->treeModel()->indexOf(package)); d->modelTreeView->selectFromSourceModelIndex(documentController->treeModel()->indexOf(package));
QTimer::singleShot(0, this, [this]() { onEditSelectedElement(); }); QTimer::singleShot(0, this, [this] { onEditSelectedElement(); });
} }
void ModelEditor::onAddComponent() void ModelEditor::onAddComponent()
@@ -880,7 +880,7 @@ void ModelEditor::onAddComponent()
qmt::MComponent *component = documentController->createNewComponent(d->modelTreeViewServant->selectedPackage()); qmt::MComponent *component = documentController->createNewComponent(d->modelTreeViewServant->selectedPackage());
d->modelTreeView->selectFromSourceModelIndex(documentController->treeModel()->indexOf(component)); d->modelTreeView->selectFromSourceModelIndex(documentController->treeModel()->indexOf(component));
QTimer::singleShot(0, this, [this]() { onEditSelectedElement(); }); QTimer::singleShot(0, this, [this] { onEditSelectedElement(); });
} }
void ModelEditor::onAddClass() void ModelEditor::onAddClass()
@@ -889,7 +889,7 @@ void ModelEditor::onAddClass()
qmt::MClass *klass = documentController->createNewClass(d->modelTreeViewServant->selectedPackage()); qmt::MClass *klass = documentController->createNewClass(d->modelTreeViewServant->selectedPackage());
d->modelTreeView->selectFromSourceModelIndex(documentController->treeModel()->indexOf(klass)); d->modelTreeView->selectFromSourceModelIndex(documentController->treeModel()->indexOf(klass));
QTimer::singleShot(0, this, [this]() { onEditSelectedElement(); }); QTimer::singleShot(0, this, [this] { onEditSelectedElement(); });
} }
void ModelEditor::onAddCanvasDiagram() void ModelEditor::onAddCanvasDiagram()
@@ -898,7 +898,7 @@ void ModelEditor::onAddCanvasDiagram()
qmt::MDiagram *diagram = documentController->createNewCanvasDiagram(d->modelTreeViewServant->selectedPackage()); qmt::MDiagram *diagram = documentController->createNewCanvasDiagram(d->modelTreeViewServant->selectedPackage());
d->modelTreeView->selectFromSourceModelIndex(documentController->treeModel()->indexOf(diagram)); d->modelTreeView->selectFromSourceModelIndex(documentController->treeModel()->indexOf(diagram));
QTimer::singleShot(0, this, [this]() { onEditSelectedElement(); }); QTimer::singleShot(0, this, [this] { onEditSelectedElement(); });
} }
void ModelEditor::onCurrentEditorChanged(Core::IEditor *editor) void ModelEditor::onCurrentEditorChanged(Core::IEditor *editor)
@@ -987,7 +987,7 @@ void ModelEditor::onNewElementCreated(qmt::DElement *element, qmt::MDiagram *dia
documentController->diagramsManager()->diagramSceneModel(diagram)->selectElement(element); documentController->diagramsManager()->diagramSceneModel(diagram)->selectElement(element);
qmt::MElement *melement = documentController->modelController()->findElement(element->modelUid()); qmt::MElement *melement = documentController->modelController()->findElement(element->modelUid());
if (!(melement && melement->flags().testFlag(qmt::MElement::ReverseEngineered))) if (!(melement && melement->flags().testFlag(qmt::MElement::ReverseEngineered)))
QTimer::singleShot(0, this, [this]() { onEditSelectedElement(); }); QTimer::singleShot(0, this, [this] { onEditSelectedElement(); });
} }
} }

View File

@@ -64,7 +64,7 @@ PerfDataReader::PerfDataReader(QObject *parent) :
}); });
connect(&m_input, &QIODevice::bytesWritten, this, &PerfDataReader::writeChunk); connect(&m_input, &QIODevice::bytesWritten, this, &PerfDataReader::writeChunk);
connect(&m_input, &QProcess::started, this, [this]() { connect(&m_input, &QProcess::started, this, [this] {
emit processStarted(); emit processStarted();
if (m_input.isWritable()) { if (m_input.isWritable()) {
writeChunk(); writeChunk();
@@ -109,7 +109,7 @@ PerfDataReader::PerfDataReader(QObject *parent) :
}); });
connect(&m_input, &QProcess::readyReadStandardOutput, this, &PerfDataReader::readFromDevice); connect(&m_input, &QProcess::readyReadStandardOutput, this, &PerfDataReader::readFromDevice);
connect(&m_input, &QProcess::readyReadStandardError, this, [this]() { connect(&m_input, &QProcess::readyReadStandardError, this, [this] {
Core::MessageManager::writeSilently(QString::fromLocal8Bit(m_input.readAllStandardError())); Core::MessageManager::writeSilently(QString::fromLocal8Bit(m_input.readAllStandardError()));
}); });

View File

@@ -88,7 +88,7 @@ PerfProfilerTool::PerfProfilerTool()
m_limitToRange = new QAction(Tr::tr("Limit to Range Selected in Timeline"), options); m_limitToRange = new QAction(Tr::tr("Limit to Range Selected in Timeline"), options);
command = Core::ActionManager::registerAction(m_limitToRange, Constants::PerfProfilerTaskLimit, command = Core::ActionManager::registerAction(m_limitToRange, Constants::PerfProfilerTaskLimit,
globalContext); globalContext);
connect(m_limitToRange, &QAction::triggered, this, [this]() { connect(m_limitToRange, &QAction::triggered, this, [this] {
traceManager().restrictByFilter(traceManager().rangeAndThreadFilter( traceManager().restrictByFilter(traceManager().rangeAndThreadFilter(
m_zoomControl->selectionStart(), m_zoomControl->selectionStart(),
m_zoomControl->selectionEnd())); m_zoomControl->selectionEnd()));
@@ -271,12 +271,12 @@ void PerfProfilerTool::createViews()
errorDialog->show(); errorDialog->show();
}); });
connect(&traceManager(), &PerfProfilerTraceManager::loadFinished, this, [this]() { connect(&traceManager(), &PerfProfilerTraceManager::loadFinished, this, [this] {
m_readerRunning = false; m_readerRunning = false;
updateRunActions(); updateRunActions();
}); });
connect(&traceManager(), &PerfProfilerTraceManager::saveFinished, this, [this]() { connect(&traceManager(), &PerfProfilerTraceManager::saveFinished, this, [this] {
setToolActionsEnabled(true); setToolActionsEnabled(true);
}); });

View File

@@ -119,7 +119,7 @@ PerfProfilerTraceManager::PerfProfilerTraceManager()
&m_reparseTimer, QOverload<>::of(&QTimer::start)); &m_reparseTimer, QOverload<>::of(&QTimer::start));
connect(&m_reparseTimer, &QTimer::timeout, connect(&m_reparseTimer, &QTimer::timeout,
this, [this]() { restrictByFilter(rangeAndThreadFilter(traceStart(), traceEnd())); }); this, [this] { restrictByFilter(rangeAndThreadFilter(traceStart(), traceEnd())); });
resetAttributes(); resetAttributes();
} }

View File

@@ -93,7 +93,7 @@ PerfConfigWidget::PerfConfigWidget(PerfSettings *settings, Target *target)
this, &PerfConfigWidget::readTracePoints); this, &PerfConfigWidget::readTracePoints);
auto addEventButton = new QPushButton(Tr::tr("Add Event"), this); auto addEventButton = new QPushButton(Tr::tr("Add Event"), this);
connect(addEventButton, &QPushButton::pressed, this, [this]() { connect(addEventButton, &QPushButton::pressed, this, [this] {
auto model = eventsView->model(); auto model = eventsView->model();
model->insertRow(model->rowCount()); model->insertRow(model->rowCount());
}); });

View File

@@ -1191,7 +1191,7 @@ void QmakeProFile::setupFutureWatcher()
QTC_ASSERT(!m_parseFutureWatcher, return); QTC_ASSERT(!m_parseFutureWatcher, return);
m_parseFutureWatcher = new QFutureWatcher<Internal::QmakeEvalResultPtr>; m_parseFutureWatcher = new QFutureWatcher<Internal::QmakeEvalResultPtr>;
QObject::connect(m_parseFutureWatcher, &QFutureWatcherBase::finished, [this]() { QObject::connect(m_parseFutureWatcher, &QFutureWatcherBase::finished, [this] {
applyEvaluate(m_parseFutureWatcher->result()); applyEvaluate(m_parseFutureWatcher->result());
cleanupFutureWatcher(); cleanupFutureWatcher();
}); });

View File

@@ -91,7 +91,7 @@ AssetExportDialog::AssetExportDialog(const FilePath &exportPath,
m_exportPath->setPromptDialogTitle(tr("Choose Export File")); m_exportPath->setPromptDialogTitle(tr("Choose Export File"));
m_exportPath->setPromptDialogFilter(tr("Metadata file (*.metadata)")); m_exportPath->setPromptDialogFilter(tr("Metadata file (*.metadata)"));
m_exportPath->lineEdit()->setReadOnly(true); m_exportPath->lineEdit()->setReadOnly(true);
m_exportPath->addButton(tr("Open"), this, [this]() { m_exportPath->addButton(tr("Open"), this, [this] {
Core::FileUtils::showInGraphicalShell(Core::ICore::dialogParent(), m_exportPath->filePath()); Core::FileUtils::showInGraphicalShell(Core::ICore::dialogParent(), m_exportPath->filePath());
}); });
@@ -111,7 +111,7 @@ AssetExportDialog::AssetExportDialog(const FilePath &exportPath,
m_stackedWidget->addWidget(m_exportLogs); m_stackedWidget->addWidget(m_exportLogs);
switchView(false); switchView(false);
connect(m_buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [this]() { connect(m_buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, [this] {
m_buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false); m_buttonBox->button(QDialogButtonBox::Cancel)->setEnabled(false);
m_assetExporter.cancel(); m_assetExporter.cancel();
}); });
@@ -119,13 +119,13 @@ AssetExportDialog::AssetExportDialog(const FilePath &exportPath,
m_exportBtn = m_buttonBox->addButton(tr("Export"), QDialogButtonBox::AcceptRole); m_exportBtn = m_buttonBox->addButton(tr("Export"), QDialogButtonBox::AcceptRole);
m_exportBtn->setEnabled(false); m_exportBtn->setEnabled(false);
connect(m_exportBtn, &QPushButton::clicked, this, &AssetExportDialog::onExport); connect(m_exportBtn, &QPushButton::clicked, this, &AssetExportDialog::onExport);
connect(&m_filePathModel, &FilePathModel::modelReset, this, [this]() { connect(&m_filePathModel, &FilePathModel::modelReset, this, [this] {
m_exportProgress->setRange(0, 1000); m_exportProgress->setRange(0, 1000);
m_exportProgress->setValue(0); m_exportProgress->setValue(0);
m_exportBtn->setEnabled(true); m_exportBtn->setEnabled(true);
}); });
connect(m_buttonBox->button(QDialogButtonBox::Close), &QPushButton::clicked, [this]() { connect(m_buttonBox->button(QDialogButtonBox::Close), &QPushButton::clicked, [this] {
close(); close();
}); });
m_buttonBox->button(QDialogButtonBox::Close)->setVisible(false); m_buttonBox->button(QDialogButtonBox::Close)->setVisible(false);

View File

@@ -24,9 +24,9 @@ AnnotationTabWidget::AnnotationTabWidget(QWidget *parent)
tr("Add Comment")); //timeline icons? tr("Add Comment")); //timeline icons?
auto *commentRemoveAction = new QAction(TimelineIcons::REMOVE_TIMELINE.icon(), auto *commentRemoveAction = new QAction(TimelineIcons::REMOVE_TIMELINE.icon(),
tr("Remove Comment")); //timeline icons? tr("Remove Comment")); //timeline icons?
connect(commentAddAction, &QAction::triggered, this, [this]() { addCommentTab(); }); connect(commentAddAction, &QAction::triggered, this, [this] { addCommentTab(); });
connect(commentRemoveAction, &QAction::triggered, this, [this]() { connect(commentRemoveAction, &QAction::triggered, this, [this] {
int currentIndex = this->currentIndex(); int currentIndex = this->currentIndex();
QString currentTitle = tabText(currentIndex); QString currentTitle = tabText(currentIndex);
if (QMessageBox::question(this, if (QMessageBox::question(this,

View File

@@ -113,7 +113,7 @@ void AssetsLibraryView::setResourcePath(const QString &resourcePath)
AssetsLibraryView::ImageCacheData *AssetsLibraryView::imageCacheData() AssetsLibraryView::ImageCacheData *AssetsLibraryView::imageCacheData()
{ {
std::call_once(imageCacheFlag, std::call_once(imageCacheFlag,
[this]() { m_imageCacheData = std::make_unique<ImageCacheData>(); }); [this] { m_imageCacheData = std::make_unique<ImageCacheData>(); });
return m_imageCacheData.get(); return m_imageCacheData.get();
} }

View File

@@ -54,7 +54,7 @@ BindingEditorWidget::BindingEditorWidget()
? tr("Meta+Space") ? tr("Meta+Space")
: tr("Ctrl+Space"))); : tr("Ctrl+Space")));
connect(m_completionAction, &QAction::triggered, this, [this]() { connect(m_completionAction, &QAction::triggered, this, [this] {
invokeAssist(TextEditor::Completion); invokeAssist(TextEditor::Completion);
}); });
} }

View File

@@ -16,7 +16,7 @@ AddNewBackendDialog::AddNewBackendDialog(QWidget *parent) :
connect(m_ui->comboBox, &QComboBox::currentTextChanged, this, &AddNewBackendDialog::invalidate); connect(m_ui->comboBox, &QComboBox::currentTextChanged, this, &AddNewBackendDialog::invalidate);
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, [this]() { connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, [this] {
m_applied = true; m_applied = true;
close(); close();
}); });

View File

@@ -255,15 +255,15 @@ BindingModelBackendDelegate::BindingModelBackendDelegate(BindingModel *parent)
, m_sourceNode() , m_sourceNode()
, m_sourceNodeProperty() , m_sourceNodeProperty()
{ {
connect(&m_sourceNode, &StudioQmlComboBoxBackend::activated, this, [this]() { connect(&m_sourceNode, &StudioQmlComboBoxBackend::activated, this, [this] {
sourceNodeChanged(); sourceNodeChanged();
}); });
connect(&m_sourceNodeProperty, &StudioQmlComboBoxBackend::activated, this, [this]() { connect(&m_sourceNodeProperty, &StudioQmlComboBoxBackend::activated, this, [this] {
sourcePropertyNameChanged(); sourcePropertyNameChanged();
}); });
connect(&m_property, &StudioQmlComboBoxBackend::activated, this, [this]() { connect(&m_property, &StudioQmlComboBoxBackend::activated, this, [this] {
targetPropertyNameChanged(); targetPropertyNameChanged();
}); });
} }
@@ -373,7 +373,7 @@ void BindingModelBackendDelegate::sourcePropertyNameChanged() const
void BindingModelBackendDelegate::targetPropertyNameChanged() const void BindingModelBackendDelegate::targetPropertyNameChanged() const
{ {
auto commit = [this]() { auto commit = [this] {
BindingModel *model = qobject_cast<BindingModel *>(parent()); BindingModel *model = qobject_cast<BindingModel *>(parent());
QTC_ASSERT(model, return); QTC_ASSERT(model, return);
const PropertyName propertyName = m_property.currentText().toUtf8(); const PropertyName propertyName = m_property.currentText().toUtf8();

View File

@@ -675,21 +675,21 @@ ConnectionModelBackendDelegate::ConnectionModelBackendDelegate(ConnectionModel *
m_propertyTreeModel(parent->connectionView()), m_propertyListProxyModel(&m_propertyTreeModel) m_propertyTreeModel(parent->connectionView()), m_propertyListProxyModel(&m_propertyTreeModel)
{ {
connect(&m_signalDelegate, &PropertyTreeModelDelegate::commitData, this, [this]() { connect(&m_signalDelegate, &PropertyTreeModelDelegate::commitData, this, [this] {
handleTargetChanged(); handleTargetChanged();
}); });
connect(&m_okStatementDelegate, connect(&m_okStatementDelegate,
&ConnectionModelStatementDelegate::statementChanged, &ConnectionModelStatementDelegate::statementChanged,
this, this,
[this]() { handleOkStatementChanged(); }); [this] { handleOkStatementChanged(); });
connect(&m_koStatementDelegate, connect(&m_koStatementDelegate,
&ConnectionModelStatementDelegate::statementChanged, &ConnectionModelStatementDelegate::statementChanged,
this, this,
[this]() { handleKOStatementChanged(); }); [this] { handleKOStatementChanged(); });
connect(&m_conditionListModel, &ConditionListModel::conditionChanged, this, [this]() { connect(&m_conditionListModel, &ConditionListModel::conditionChanged, this, [this] {
handleConditionChanged(); handleConditionChanged();
}); });
@@ -1209,27 +1209,27 @@ ConnectionModelStatementDelegate::ConnectionModelStatementDelegate(ConnectionMod
{ {
m_functionDelegate.setPropertyType(PropertyTreeModel::SlotType); m_functionDelegate.setPropertyType(PropertyTreeModel::SlotType);
connect(&m_functionDelegate, &PropertyTreeModelDelegate::commitData, this, [this]() { connect(&m_functionDelegate, &PropertyTreeModelDelegate::commitData, this, [this] {
handleFunctionChanged(); handleFunctionChanged();
}); });
connect(&m_rhsAssignmentDelegate, &PropertyTreeModelDelegate::commitData, this, [this]() { connect(&m_rhsAssignmentDelegate, &PropertyTreeModelDelegate::commitData, this, [this] {
handleRhsAssignmentChanged(); handleRhsAssignmentChanged();
}); });
connect(&m_lhsDelegate, &PropertyTreeModelDelegate::commitData, this, [this]() { connect(&m_lhsDelegate, &PropertyTreeModelDelegate::commitData, this, [this] {
handleLhsChanged(); handleLhsChanged();
}); });
connect(&m_stringArgument, &StudioQmlTextBackend::activated, this, [this]() { connect(&m_stringArgument, &StudioQmlTextBackend::activated, this, [this] {
handleStringArgumentChanged(); handleStringArgumentChanged();
}); });
connect(&m_states, &StudioQmlComboBoxBackend::activated, this, [this]() { connect(&m_states, &StudioQmlComboBoxBackend::activated, this, [this] {
handleStateChanged(); handleStateChanged();
}); });
connect(&m_stateTargets, &StudioQmlComboBoxBackend::activated, this, [this]() { connect(&m_stateTargets, &StudioQmlComboBoxBackend::activated, this, [this] {
handleStateTargetsChanged(); handleStateTargetsChanged();
}); });
} }

View File

@@ -388,9 +388,9 @@ DynamicPropertiesModelBackendDelegate::DynamicPropertiesModelBackendDelegate(Dyn
, m_internalNodeId(std::nullopt) , m_internalNodeId(std::nullopt)
{ {
m_type.setModel({"int", "bool", "var", "real", "string", "url", "color"}); m_type.setModel({"int", "bool", "var", "real", "string", "url", "color"});
connect(&m_type, &StudioQmlComboBoxBackend::activated, this, [this]() { handleTypeChanged(); }); connect(&m_type, &StudioQmlComboBoxBackend::activated, this, [this] { handleTypeChanged(); });
connect(&m_name, &StudioQmlTextBackend::activated, this, [this]() { handleNameChanged(); }); connect(&m_name, &StudioQmlTextBackend::activated, this, [this] { handleNameChanged(); });
connect(&m_value, &StudioQmlTextBackend::activated, this, [this]() { handleValueChanged(); }); connect(&m_value, &StudioQmlTextBackend::activated, this, [this] { handleValueChanged(); });
} }
void DynamicPropertiesModelBackendDelegate::update(const AbstractProperty &property) void DynamicPropertiesModelBackendDelegate::update(const AbstractProperty &property)

View File

@@ -888,10 +888,10 @@ QString PropertyListProxyModel::parentName() const
PropertyTreeModelDelegate::PropertyTreeModelDelegate(ConnectionView *parent) : m_model(parent) PropertyTreeModelDelegate::PropertyTreeModelDelegate(ConnectionView *parent) : m_model(parent)
{ {
connect(&m_nameCombboBox, &StudioQmlComboBoxBackend::activated, this, [this]() { connect(&m_nameCombboBox, &StudioQmlComboBoxBackend::activated, this, [this] {
handleNameChanged(); handleNameChanged();
}); });
connect(&m_idCombboBox, &StudioQmlComboBoxBackend::activated, this, [this]() { connect(&m_idCombboBox, &StudioQmlComboBoxBackend::activated, this, [this] {
handleIdChanged(); handleIdChanged();
}); });

View File

@@ -151,7 +151,7 @@ QString ContentLibraryBundleImporter::importComponent(const QString &qmlFile,
void ContentLibraryBundleImporter::handleImportTimer() void ContentLibraryBundleImporter::handleImportTimer()
{ {
auto handleFailure = [this]() { auto handleFailure = [this] {
m_importTimer.stop(); m_importTimer.stop();
m_fullReset = false; m_fullReset = false;
m_importAddPending = false; m_importAddPending = false;

View File

@@ -57,7 +57,7 @@ CurveEditor::CurveEditor(CurveEditorModel *model, QWidget *parent)
box->addWidget(m_statusLine); box->addWidget(m_statusLine);
setLayout(box); setLayout(box);
connect(m_toolbar, &CurveEditorToolBar::unifyClicked, [this]() { connect(m_toolbar, &CurveEditorToolBar::unifyClicked, [this] {
m_view->toggleUnified(); m_view->toggleUnified();
}); });

View File

@@ -75,16 +75,16 @@ CurveEditorToolBar::CurveEditorToolBar(CurveEditorModel *model, QWidget* parent)
m_splineAction = addAction(Theme::iconFromName(Theme::bezier_medium), tr(m_splineLabel)); m_splineAction = addAction(Theme::iconFromName(Theme::bezier_medium), tr(m_splineLabel));
m_unifyAction = addAction(Theme::iconFromName(Theme::unify_medium), tr(m_unifyLabel)); m_unifyAction = addAction(Theme::iconFromName(Theme::unify_medium), tr(m_unifyLabel));
auto setLinearInterpolation = [this]() { auto setLinearInterpolation = [this] {
emit interpolationClicked(Keyframe::Interpolation::Linear); emit interpolationClicked(Keyframe::Interpolation::Linear);
}; };
auto setStepInterpolation = [this]() { auto setStepInterpolation = [this] {
emit interpolationClicked(Keyframe::Interpolation::Step); emit interpolationClicked(Keyframe::Interpolation::Step);
}; };
auto setSplineInterpolation = [this]() { auto setSplineInterpolation = [this] {
emit interpolationClicked(Keyframe::Interpolation::Bezier); emit interpolationClicked(Keyframe::Interpolation::Bezier);
}; };
auto toggleUnifyKeyframe = [this]() { auto toggleUnifyKeyframe = [this] {
emit unifyClicked(); emit unifyClicked();
}; };
@@ -170,7 +170,7 @@ CurveEditorToolBar::CurveEditorToolBar(CurveEditorModel *model, QWidget* parent)
tr("Zoom Out"), tr("Zoom Out"),
QKeySequence(QKeySequence::ZoomOut)); QKeySequence(QKeySequence::ZoomOut));
connect(zoomOut, &QAction::triggered, [this]() { connect(zoomOut, &QAction::triggered, [this] {
m_zoomSlider->setValue(m_zoomSlider->value() - m_zoomSlider->pageStep()); m_zoomSlider->setValue(m_zoomSlider->value() - m_zoomSlider->pageStep());
}); });
@@ -179,7 +179,7 @@ CurveEditorToolBar::CurveEditorToolBar(CurveEditorModel *model, QWidget* parent)
tr("Zoom In"), tr("Zoom In"),
QKeySequence(QKeySequence::ZoomIn)); QKeySequence(QKeySequence::ZoomIn));
connect(zoomIn, &QAction::triggered, [this]() { connect(zoomIn, &QAction::triggered, [this] {
m_zoomSlider->setValue(m_zoomSlider->value() + m_zoomSlider->pageStep()); m_zoomSlider->setValue(m_zoomSlider->value() + m_zoomSlider->pageStep());
}); });

View File

@@ -410,7 +410,7 @@ void GraphicsView::contextMenuEvent(QContextMenuEvent *event)
if (event->modifiers() != Qt::NoModifier) if (event->modifiers() != Qt::NoModifier)
return; return;
auto openStyleEditor = [this]() { m_dialog.show(); }; auto openStyleEditor = [this] { m_dialog.show(); };
QMenu menu; QMenu menu;

View File

@@ -193,7 +193,7 @@ void KeyframeItem::setKeyframe(const Keyframe &keyframe)
m_frame = keyframe; m_frame = keyframe;
if (needsConnection) { if (needsConnection) {
auto updatePosition = [this]() { this->updatePosition(true); }; auto updatePosition = [this] { this->updatePosition(true); };
connect(this, &QGraphicsObject::xChanged, updatePosition); connect(this, &QGraphicsObject::xChanged, updatePosition);
connect(this, &QGraphicsObject::yChanged, updatePosition); connect(this, &QGraphicsObject::yChanged, updatePosition);
} }
@@ -201,7 +201,7 @@ void KeyframeItem::setKeyframe(const Keyframe &keyframe)
if (m_frame.hasLeftHandle()) { if (m_frame.hasLeftHandle()) {
if (!m_left) { if (!m_left) {
m_left = new HandleItem(this, HandleItem::Slot::Left); m_left = new HandleItem(this, HandleItem::Slot::Left);
auto updateLeftHandle = [this]() { updateHandle(m_left); }; auto updateLeftHandle = [this] { updateHandle(m_left); };
connect(m_left, &QGraphicsObject::xChanged, updateLeftHandle); connect(m_left, &QGraphicsObject::xChanged, updateLeftHandle);
connect(m_left, &QGraphicsObject::yChanged, updateLeftHandle); connect(m_left, &QGraphicsObject::yChanged, updateLeftHandle);
} }
@@ -214,7 +214,7 @@ void KeyframeItem::setKeyframe(const Keyframe &keyframe)
if (m_frame.hasRightHandle()) { if (m_frame.hasRightHandle()) {
if (!m_right) { if (!m_right) {
m_right = new HandleItem(this, HandleItem::Slot::Right); m_right = new HandleItem(this, HandleItem::Slot::Right);
auto updateRightHandle = [this]() { updateHandle(m_right); }; auto updateRightHandle = [this] { updateHandle(m_right); };
connect(m_right, &QGraphicsObject::xChanged, updateRightHandle); connect(m_right, &QGraphicsObject::xChanged, updateRightHandle);
connect(m_right, &QGraphicsObject::yChanged, updateRightHandle); connect(m_right, &QGraphicsObject::yChanged, updateRightHandle);
} }

View File

@@ -26,7 +26,7 @@ TreeView::TreeView(CurveEditorModel *model, QWidget *parent)
setModel(model); setModel(model);
auto expandItems = [this]() { expandAll(); }; auto expandItems = [this] { expandAll(); };
connect(model, &QAbstractItemModel::modelReset, expandItems); connect(model, &QAbstractItemModel::modelReset, expandItems);
setItemDelegate(new TreeItemDelegate(model->style(), this)); setItemDelegate(new TreeItemDelegate(model->style(), this));

View File

@@ -183,7 +183,7 @@ void BakeLights::bakeLights()
m_view->resetPuppet(); m_view->resetPuppet();
}; };
auto crashCallback = [this]() { auto crashCallback = [this] {
m_progressDialog->raise(); m_progressDialog->raise();
emit progress(tr("Baking process crashed, baking aborted.")); emit progress(tr("Baking process crashed, baking aborted."));
emit finished(); emit finished();
@@ -232,7 +232,7 @@ void BakeLights::apply()
void BakeLights::rebake() void BakeLights::rebake()
{ {
QTimer::singleShot(0, this, [this]() { QTimer::singleShot(0, this, [this] {
cleanup(); cleanup();
showSetupDialog(); showSetupDialog();
}); });

View File

@@ -1054,7 +1054,7 @@ void Edit3DView::createEdit3DActions()
if (!m_snapConfiguration) { if (!m_snapConfiguration) {
m_snapConfiguration = new SnapConfiguration(this); m_snapConfiguration = new SnapConfiguration(this);
connect(m_snapConfiguration.data(), &SnapConfiguration::posIntChanged, connect(m_snapConfiguration.data(), &SnapConfiguration::posIntChanged,
this, [this]() { this, [this] {
// Notify every change of position interval as that causes visible changes in grid // Notify every change of position interval as that causes visible changes in grid
rootModelNode().setAuxiliaryData(edit3dSnapPosIntProperty, rootModelNode().setAuxiliaryData(edit3dSnapPosIntProperty,
m_snapConfiguration->posInt()); m_snapConfiguration->posInt());

View File

@@ -235,7 +235,7 @@ void SnapConfiguration::setScaleInt(double value)
void SnapConfiguration::asyncClose() void SnapConfiguration::asyncClose()
{ {
QTimer::singleShot(0, this, [this]() { QTimer::singleShot(0, this, [this] {
if (!m_configDialog.isNull() && m_configDialog->isVisible()) if (!m_configDialog.isNull() && m_configDialog->isVisible())
m_configDialog->close(); m_configDialog->close();
}); });

View File

@@ -51,7 +51,7 @@ void EventListPluginView::registerActions()
&SelectionContextFunctors::always, &SelectionContextFunctors::always,
&SelectionContextFunctors::always)); &SelectionContextFunctors::always));
auto eventListAction = new EventListAction(); auto eventListAction = new EventListAction();
connect(eventListAction->action(), &QAction::triggered, [this]() { connect(eventListAction->action(), &QAction::triggered, [this] {
if (!m_eventListDialog) if (!m_eventListDialog)
m_eventListDialog = new EventListDialog(Core::ICore::dialogParent()); m_eventListDialog = new EventListDialog(Core::ICore::dialogParent());
@@ -62,7 +62,7 @@ void EventListPluginView::registerActions()
designerActionManager.addDesignerAction(eventListAction); designerActionManager.addDesignerAction(eventListAction);
auto assignEventAction = new AssignEventEditorAction(); auto assignEventAction = new AssignEventEditorAction();
connect(assignEventAction->action(), &QAction::triggered, [this]() { connect(assignEventAction->action(), &QAction::triggered, [this] {
if (!m_assigner) if (!m_assigner)
m_assigner = new AssignEventDialog(Core::ICore::dialogParent()); m_assigner = new AssignEventDialog(Core::ICore::dialogParent());
if (!m_eventListDialog) if (!m_eventListDialog)

View File

@@ -182,11 +182,11 @@ void FormEditorAnnotationIcon::mouseReleaseEvent(QGraphicsSceneMouseEvent * even
void FormEditorAnnotationIcon::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void FormEditorAnnotationIcon::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
{ {
QMenu menu; QMenu menu;
menu.addAction(tr("Edit Annotation"), [this]() { menu.addAction(tr("Edit Annotation"), [this] {
createAnnotationEditor(); createAnnotationEditor();
}); });
menu.addAction(tr("Remove Annotation"), [this]() { menu.addAction(tr("Remove Annotation"), [this] {
removeAnnotationDialog(); removeAnnotationDialog();
}); });

View File

@@ -208,7 +208,7 @@ void FormEditorView::createFormEditorWidget()
auto formEditorContext = new Internal::FormEditorContext(m_formEditorWidget.data()); auto formEditorContext = new Internal::FormEditorContext(m_formEditorWidget.data());
Core::ICore::addContextObject(formEditorContext); Core::ICore::addContextObject(formEditorContext);
connect(m_formEditorWidget->zoomAction(), &ZoomAction::zoomLevelChanged, [this]() { connect(m_formEditorWidget->zoomAction(), &ZoomAction::zoomLevelChanged, [this] {
m_currentTool->formEditorItemsChanged(scene()->allFormEditorItems()); m_currentTool->formEditorItemsChanged(scene()->allFormEditorItems());
}); });
@@ -223,7 +223,7 @@ void FormEditorView::temporaryBlockView(int duration)
timer->setSingleShot(true); timer->setSingleShot(true);
timer->start(duration); timer->start(duration);
connect(timer, &QTimer::timeout, this, [this]() { connect(timer, &QTimer::timeout, this, [this] {
if (m_formEditorWidget && m_formEditorWidget->graphicsView()) if (m_formEditorWidget && m_formEditorWidget->graphicsView())
m_formEditorWidget->graphicsView()->setUpdatesEnabled(true); m_formEditorWidget->graphicsView()->setUpdatesEnabled(true);
}); });

View File

@@ -162,7 +162,7 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
const QIcon zoomOutIcon = Theme::iconFromName(Theme::Icon::zoomOut_medium); const QIcon zoomOutIcon = Theme::iconFromName(Theme::Icon::zoomOut_medium);
const QIcon reloadIcon = Theme::iconFromName(Theme::Icon::reload_medium); const QIcon reloadIcon = Theme::iconFromName(Theme::Icon::reload_medium);
auto writeZoomLevel = [this]() { auto writeZoomLevel = [this] {
double level = m_graphicsView->transform().m11(); double level = m_graphicsView->transform().m11();
if (level == 1.0) { if (level == 1.0) {
m_formEditorView->rootModelNode().removeAuxiliaryData(formeditorZoomProperty); m_formEditorView->rootModelNode().removeAuxiliaryData(formeditorZoomProperty);

View File

@@ -574,7 +574,7 @@ void DesignDocument::deleteSelected()
return; return;
} }
rewriterView()->executeInTransaction("DesignDocument::deleteSelected", [this]() { rewriterView()->executeInTransaction("DesignDocument::deleteSelected", [this] {
const QList<ModelNode> toDelete = view()->selectedModelNodes(); const QList<ModelNode> toDelete = view()->selectedModelNodes();
for (ModelNode node : toDelete) { for (ModelNode node : toDelete) {
if (node.isValid() && !node.isRootNode() && QmlObjectNode::isValidQmlObjectNode(node)) if (node.isValid() && !node.isRootNode() && QmlObjectNode::isValidQmlObjectNode(node))

View File

@@ -235,7 +235,7 @@ void MaterialBrowserView::modelAttached(Model *model)
// Project load is already very busy and may even trigger puppet reset, so let's wait a moment // Project load is already very busy and may even trigger puppet reset, so let's wait a moment
// before refreshing the model // before refreshing the model
QTimer::singleShot(1000, model, [this]() { QTimer::singleShot(1000, model, [this] {
refreshModel(true); refreshModel(true);
loadPropertyGroups(); // Needs the delay because it uses metaInfo loadPropertyGroups(); // Needs the delay because it uses metaInfo
}); });
@@ -523,7 +523,7 @@ void MaterialBrowserView::customNotification(const AbstractView *view,
m_widget->focusMaterialSection(false); m_widget->focusMaterialSection(false);
} }
} else if (identifier == "refresh_material_browser") { } else if (identifier == "refresh_material_browser") {
QTimer::singleShot(0, model(), [this]() { QTimer::singleShot(0, model(), [this] {
refreshModel(true); refreshModel(true);
}); });
} else if (identifier == "delete_selected_material") { } else if (identifier == "delete_selected_material") {
@@ -557,7 +557,7 @@ void MaterialBrowserView::instancesCompleted(const QVector<ModelNode> &completed
// We use root node completion as indication of puppet reset // We use root node completion as indication of puppet reset
if (node.isRootNode()) { if (node.isRootNode()) {
m_puppetResetPending = false; m_puppetResetPending = false;
QTimer::singleShot(1000, this, [this]() { QTimer::singleShot(1000, this, [this] {
if (!model() || !model()->nodeInstanceView()) if (!model() || !model()->nodeInstanceView())
return; return;
const QList<ModelNode> materials = m_widget->materialBrowserModel()->materials(); const QList<ModelNode> materials = m_widget->materialBrowserModel()->materials();

View File

@@ -143,7 +143,7 @@ RichTextEditor::RichTextEditor(QWidget *parent)
this, &RichTextEditor::cursorPositionChanged); this, &RichTextEditor::cursorPositionChanged);
connect(m_textEdit, &QTextEdit::textChanged, connect(m_textEdit, &QTextEdit::textChanged,
this, &RichTextEditor::onTextChanged); this, &RichTextEditor::onTextChanged);
connect(m_linkDialog, &QDialog::accepted, [this]() { connect(m_linkDialog, &QDialog::accepted, [this] {
QTextCharFormat oldFormat = m_textEdit->textCursor().charFormat(); QTextCharFormat oldFormat = m_textEdit->textCursor().charFormat();
QTextCursor tcursor = m_textEdit->textCursor(); QTextCursor tcursor = m_textEdit->textCursor();
@@ -392,7 +392,7 @@ void RichTextEditor::setupTextActions()
void RichTextEditor::setupImageActions() void RichTextEditor::setupImageActions()
{ {
auto insertImage = [this]() { auto insertImage = [this] {
QFileDialog dialog(this); QFileDialog dialog(this);
dialog.setFileMode(QFileDialog::ExistingFile); dialog.setFileMode(QFileDialog::ExistingFile);
dialog.setWindowTitle(tr("Select Image")); dialog.setWindowTitle(tr("Select Image"));
@@ -417,7 +417,7 @@ void RichTextEditor::setupImageActions()
void RichTextEditor::setupHyperlinkActions() void RichTextEditor::setupHyperlinkActions()
{ {
const QIcon bulletIcon(getIcon(Theme::Icon::actionIconBinding)); const QIcon bulletIcon(getIcon(Theme::Icon::actionIconBinding));
m_actionHyperlink = m_toolBar->addAction(bulletIcon, tr("Hyperlink Settings"), [this]() { m_actionHyperlink = m_toolBar->addAction(bulletIcon, tr("Hyperlink Settings"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
QTextCharFormat linkFormat = cursor.charFormat(); QTextCharFormat linkFormat = cursor.charFormat();
if (linkFormat.isAnchor()) { if (linkFormat.isAnchor()) {
@@ -440,25 +440,25 @@ void RichTextEditor::setupHyperlinkActions()
void RichTextEditor::setupAlignActions() void RichTextEditor::setupAlignActions()
{ {
const QIcon leftIcon(getIcon(Theme::Icon::textAlignLeft)); const QIcon leftIcon(getIcon(Theme::Icon::textAlignLeft));
m_actionAlignLeft = m_toolBar->addAction(leftIcon, tr("&Left"), [this]() { m_textEdit->setAlignment(Qt::AlignLeft | Qt::AlignAbsolute); }); m_actionAlignLeft = m_toolBar->addAction(leftIcon, tr("&Left"), [this] { m_textEdit->setAlignment(Qt::AlignLeft | Qt::AlignAbsolute); });
m_actionAlignLeft->setShortcut(Qt::CTRL | Qt::Key_L); m_actionAlignLeft->setShortcut(Qt::CTRL | Qt::Key_L);
m_actionAlignLeft->setCheckable(true); m_actionAlignLeft->setCheckable(true);
m_actionAlignLeft->setPriority(QAction::LowPriority); m_actionAlignLeft->setPriority(QAction::LowPriority);
const QIcon centerIcon(getIcon(Theme::Icon::textAlignCenter)); const QIcon centerIcon(getIcon(Theme::Icon::textAlignCenter));
m_actionAlignCenter = m_toolBar->addAction(centerIcon, tr("C&enter"), [this]() { m_textEdit->setAlignment(Qt::AlignHCenter); }); m_actionAlignCenter = m_toolBar->addAction(centerIcon, tr("C&enter"), [this] { m_textEdit->setAlignment(Qt::AlignHCenter); });
m_actionAlignCenter->setShortcut(Qt::CTRL | Qt::Key_E); m_actionAlignCenter->setShortcut(Qt::CTRL | Qt::Key_E);
m_actionAlignCenter->setCheckable(true); m_actionAlignCenter->setCheckable(true);
m_actionAlignCenter->setPriority(QAction::LowPriority); m_actionAlignCenter->setPriority(QAction::LowPriority);
const QIcon rightIcon(getIcon(Theme::Icon::textAlignRight)); const QIcon rightIcon(getIcon(Theme::Icon::textAlignRight));
m_actionAlignRight = m_toolBar->addAction(rightIcon, tr("&Right"), [this]() { m_textEdit->setAlignment(Qt::AlignRight | Qt::AlignAbsolute); }); m_actionAlignRight = m_toolBar->addAction(rightIcon, tr("&Right"), [this] { m_textEdit->setAlignment(Qt::AlignRight | Qt::AlignAbsolute); });
m_actionAlignRight->setShortcut(Qt::CTRL | Qt::Key_R); m_actionAlignRight->setShortcut(Qt::CTRL | Qt::Key_R);
m_actionAlignRight->setCheckable(true); m_actionAlignRight->setCheckable(true);
m_actionAlignRight->setPriority(QAction::LowPriority); m_actionAlignRight->setPriority(QAction::LowPriority);
const QIcon fillIcon(getIcon(Theme::Icon::textFullJustification)); const QIcon fillIcon(getIcon(Theme::Icon::textFullJustification));
m_actionAlignJustify = m_toolBar->addAction(fillIcon, tr("&Justify"), [this]() { m_textEdit->setAlignment(Qt::AlignJustify); }); m_actionAlignJustify = m_toolBar->addAction(fillIcon, tr("&Justify"), [this] { m_textEdit->setAlignment(Qt::AlignJustify); });
m_actionAlignJustify->setShortcut(Qt::CTRL | Qt::Key_J); m_actionAlignJustify->setShortcut(Qt::CTRL | Qt::Key_J);
m_actionAlignJustify->setCheckable(true); m_actionAlignJustify->setCheckable(true);
m_actionAlignJustify->setPriority(QAction::LowPriority); m_actionAlignJustify->setPriority(QAction::LowPriority);
@@ -515,7 +515,7 @@ void RichTextEditor::setupFontActions()
{ {
QPixmap colorBox(drawColorBox(m_textEdit->textColor(), m_tableBar->iconSize())); QPixmap colorBox(drawColorBox(m_textEdit->textColor(), m_tableBar->iconSize()));
m_actionTextColor = m_toolBar->addAction(colorBox, tr("&Color..."), [this]() { m_actionTextColor = m_toolBar->addAction(colorBox, tr("&Color..."), [this] {
QColor col = QColorDialog::getColor(m_textEdit->textColor(), this); QColor col = QColorDialog::getColor(m_textEdit->textColor(), this);
if (!col.isValid()) if (!col.isValid())
return; return;
@@ -580,7 +580,7 @@ void RichTextEditor::setupTableActions()
//table bar: //table bar:
const QIcon createTableIcon(getIcon(Theme::Icon::addTable)); const QIcon createTableIcon(getIcon(Theme::Icon::addTable));
m_actionCreateTable = m_tableBar->addAction(createTableIcon, tr("Create Table"), [this]() { m_actionCreateTable = m_tableBar->addAction(createTableIcon, tr("Create Table"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
cursorEditBlock(cursor, [&] () { cursorEditBlock(cursor, [&] () {
//format table cells to look a bit better: //format table cells to look a bit better:
@@ -598,7 +598,7 @@ void RichTextEditor::setupTableActions()
m_actionCreateTable->setCheckable(false); m_actionCreateTable->setCheckable(false);
const QIcon removeTableIcon(getIcon(Theme::Icon::deleteTable)); const QIcon removeTableIcon(getIcon(Theme::Icon::deleteTable));
m_actionRemoveTable = m_tableBar->addAction(removeTableIcon, tr("Remove Table"), [this]() { m_actionRemoveTable = m_tableBar->addAction(removeTableIcon, tr("Remove Table"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
if (QTextTable *currentTable = m_textEdit->textCursor().currentTable()) { if (QTextTable *currentTable = m_textEdit->textCursor().currentTable()) {
cursorEditBlock(cursor, [&] () { cursorEditBlock(cursor, [&] () {
@@ -611,7 +611,7 @@ void RichTextEditor::setupTableActions()
m_tableBar->addSeparator(); m_tableBar->addSeparator();
const QIcon addRowIcon(getIcon(Theme::Icon::addRowAfter)); //addRowAfter const QIcon addRowIcon(getIcon(Theme::Icon::addRowAfter)); //addRowAfter
m_actionAddRow = m_tableBar->addAction(addRowIcon, tr("Add Row"), [this]() { m_actionAddRow = m_tableBar->addAction(addRowIcon, tr("Add Row"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
if (QTextTable *currentTable = m_textEdit->textCursor().currentTable()) { if (QTextTable *currentTable = m_textEdit->textCursor().currentTable()) {
cursorEditBlock(cursor, [&] () { cursorEditBlock(cursor, [&] () {
@@ -622,7 +622,7 @@ void RichTextEditor::setupTableActions()
m_actionAddRow->setCheckable(false); m_actionAddRow->setCheckable(false);
const QIcon addColumnIcon(getIcon(Theme::Icon::addColumnAfter)); //addColumnAfter const QIcon addColumnIcon(getIcon(Theme::Icon::addColumnAfter)); //addColumnAfter
m_actionAddColumn = m_tableBar->addAction(addColumnIcon, tr("Add Column"), [this]() { m_actionAddColumn = m_tableBar->addAction(addColumnIcon, tr("Add Column"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
if (QTextTable *currentTable = m_textEdit->textCursor().currentTable()) { if (QTextTable *currentTable = m_textEdit->textCursor().currentTable()) {
cursorEditBlock(cursor, [&] () { cursorEditBlock(cursor, [&] () {
@@ -633,7 +633,7 @@ void RichTextEditor::setupTableActions()
m_actionAddColumn->setCheckable(false); m_actionAddColumn->setCheckable(false);
const QIcon removeRowIcon(getIcon(Theme::Icon::deleteRow)); const QIcon removeRowIcon(getIcon(Theme::Icon::deleteRow));
m_actionRemoveRow = m_tableBar->addAction(removeRowIcon, tr("Remove Row"), [this]() { m_actionRemoveRow = m_tableBar->addAction(removeRowIcon, tr("Remove Row"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
if (QTextTable *currentTable = cursor.currentTable()) { if (QTextTable *currentTable = cursor.currentTable()) {
cursorEditBlock(cursor, [&] () { cursorEditBlock(cursor, [&] () {
@@ -657,7 +657,7 @@ void RichTextEditor::setupTableActions()
m_actionRemoveRow->setCheckable(false); m_actionRemoveRow->setCheckable(false);
const QIcon removeColumnIcon(getIcon(Theme::Icon::deleteColumn)); const QIcon removeColumnIcon(getIcon(Theme::Icon::deleteColumn));
m_actionRemoveColumn = m_tableBar->addAction(removeColumnIcon, tr("Remove Column"), [this]() { m_actionRemoveColumn = m_tableBar->addAction(removeColumnIcon, tr("Remove Column"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
if (QTextTable *currentTable = cursor.currentTable()) { if (QTextTable *currentTable = cursor.currentTable()) {
cursorEditBlock(cursor, [&] () { cursorEditBlock(cursor, [&] () {
@@ -681,7 +681,7 @@ void RichTextEditor::setupTableActions()
m_tableBar->addSeparator(); m_tableBar->addSeparator();
const QIcon mergeCellsIcon(getIcon(Theme::Icon::mergeCells)); const QIcon mergeCellsIcon(getIcon(Theme::Icon::mergeCells));
m_actionMergeCells = m_tableBar->addAction(mergeCellsIcon, tr("Merge Cells"), [this]() { m_actionMergeCells = m_tableBar->addAction(mergeCellsIcon, tr("Merge Cells"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
if (QTextTable *currentTable = cursor.currentTable()) { if (QTextTable *currentTable = cursor.currentTable()) {
if (cursor.hasSelection()) { if (cursor.hasSelection()) {
@@ -694,7 +694,7 @@ void RichTextEditor::setupTableActions()
m_actionMergeCells->setCheckable(false); m_actionMergeCells->setCheckable(false);
const QIcon splitRowIcon(getIcon(Theme::Icon::splitRows)); const QIcon splitRowIcon(getIcon(Theme::Icon::splitRows));
m_actionSplitRow = m_tableBar->addAction(splitRowIcon, tr("Split Row"), [this]() { m_actionSplitRow = m_tableBar->addAction(splitRowIcon, tr("Split Row"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
if (QTextTable *currentTable = cursor.currentTable()) { if (QTextTable *currentTable = cursor.currentTable()) {
cursorEditBlock(cursor, [&] () { cursorEditBlock(cursor, [&] () {
@@ -707,7 +707,7 @@ void RichTextEditor::setupTableActions()
m_actionSplitRow->setCheckable(false); m_actionSplitRow->setCheckable(false);
const QIcon splitColumnIcon(getIcon(Theme::Icon::splitColumns)); const QIcon splitColumnIcon(getIcon(Theme::Icon::splitColumns));
m_actionSplitColumn = m_tableBar->addAction(splitColumnIcon, tr("Split Column"), [this]() { m_actionSplitColumn = m_tableBar->addAction(splitColumnIcon, tr("Split Column"), [this] {
QTextCursor cursor = m_textEdit->textCursor(); QTextCursor cursor = m_textEdit->textCursor();
if (QTextTable *currentTable = cursor.currentTable()) { if (QTextTable *currentTable = cursor.currentTable()) {
cursorEditBlock(cursor, [&] () { cursorEditBlock(cursor, [&] () {

View File

@@ -34,8 +34,8 @@ RichTextEditorProxy::RichTextEditorProxy(QObject *parent)
m_dialog->setLayout(layout); m_dialog->setLayout(layout);
connect(m_dialog, &QDialog::accepted, [this]() { emit accepted(); }); connect(m_dialog, &QDialog::accepted, [this] { emit accepted(); });
connect(m_dialog, &QDialog::rejected, [this]() { emit rejected(); }); connect(m_dialog, &QDialog::rejected, [this] { emit rejected(); });
} }
RichTextEditorProxy::~RichTextEditorProxy() RichTextEditorProxy::~RichTextEditorProxy()

View File

@@ -34,7 +34,7 @@ StatesEditorModel::StatesEditorModel(StatesEditorView *view)
, m_hasExtend(false) , m_hasExtend(false)
, m_extendedStates() , m_extendedStates()
{ {
QObject::connect(this, &StatesEditorModel::dataChanged, [this]() { emit baseStateChanged(); }); QObject::connect(this, &StatesEditorModel::dataChanged, [this] { emit baseStateChanged(); });
} }
int StatesEditorModel::count() const int StatesEditorModel::count() const
@@ -363,7 +363,7 @@ void StatesEditorModel::removeStateGroup()
if (m_statesEditorView->activeStatesGroupNode().isRootNode()) if (m_statesEditorView->activeStatesGroupNode().isRootNode())
return; return;
m_statesEditorView->executeInTransaction("removeStateGroup", [this]() { m_statesEditorView->executeInTransaction("removeStateGroup", [this] {
m_statesEditorView->activeStatesGroupNode().destroy(); m_statesEditorView->activeStatesGroupNode().destroy();
}); });
} }

View File

@@ -63,7 +63,7 @@ CanvasStyleDialog::CanvasStyleDialog(const CanvasStyle &style, QWidget *parent)
setLayout(layout); setLayout(layout);
auto emitValueChanged = [this]() { auto emitValueChanged = [this] {
CanvasStyle out; CanvasStyle out;
out.aspect = m_aspect->value(); out.aspect = m_aspect->value();
out.thinLineWidth = m_thinLineWidth->value(); out.thinLineWidth = m_thinLineWidth->value();

View File

@@ -82,7 +82,7 @@ TimelineForm::TimelineForm(QWidget *parent)
expressionBindingL, m_expressionBindingLineEdit, br, expressionBindingL, m_expressionBindingLineEdit, br,
}.attachTo(this); }.attachTo(this);
connect(m_expressionBindingLineEdit, &QLineEdit::editingFinished, [this]() { connect(m_expressionBindingLineEdit, &QLineEdit::editingFinished, [this] {
QTC_ASSERT(m_timeline.isValid(), return ); QTC_ASSERT(m_timeline.isValid(), return );
const QString bindingText = m_expressionBindingLineEdit->text(); const QString bindingText = m_expressionBindingLineEdit->text();
@@ -107,7 +107,7 @@ TimelineForm::TimelineForm(QWidget *parent)
} }
}); });
connect(m_idLineEdit, &QLineEdit::editingFinished, [this]() { connect(m_idLineEdit, &QLineEdit::editingFinished, [this] {
QTC_ASSERT(m_timeline.isValid(), return ); QTC_ASSERT(m_timeline.isValid(), return );
static QString lastString; static QString lastString;

View File

@@ -76,7 +76,7 @@ TimelineGraphicsScene::TimelineGraphicsScene(TimelineWidget *parent,
setSceneRect(m_layout->geometry()); setSceneRect(m_layout->geometry());
connect(m_layout, &QGraphicsWidget::geometryChanged, this, [this]() { connect(m_layout, &QGraphicsWidget::geometryChanged, this, [this] {
auto rect = m_layout->geometry(); auto rect = m_layout->geometry();
setSceneRect(rect); setSceneRect(rect);

View File

@@ -46,7 +46,7 @@ TimelineFrameHandle::TimelineFrameHandle(TimelineItem *parent)
m_timer.setSingleShot(true); m_timer.setSingleShot(true);
m_timer.setInterval(15); m_timer.setInterval(15);
QObject::connect(&m_timer, &QTimer::timeout, [this]() { QObject::connect(&m_timer, &QTimer::timeout, [this] {
if (QApplication::mouseButtons() == Qt::LeftButton) if (QApplication::mouseButtons() == Qt::LeftButton)
scrollOutOfBounds(); scrollOutOfBounds();
}); });

View File

@@ -406,7 +406,7 @@ void TimelinePropertyItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *even
const ModelNode currentFrameNode = getModelNodeForFrame(m_frames, currentFrame()); const ModelNode currentFrameNode = getModelNodeForFrame(m_frames, currentFrame());
QAction *insertAction = mainMenu.addAction(tr("Insert Keyframe")); QAction *insertAction = mainMenu.addAction(tr("Insert Keyframe"));
QObject::connect(insertAction, &QAction::triggered, [this]() { QObject::connect(insertAction, &QAction::triggered, [this] {
timelineScene()->handleKeyframeInsertion(m_frames.target(), propertyName().toUtf8()); timelineScene()->handleKeyframeInsertion(m_frames.target(), propertyName().toUtf8());
}); });
@@ -442,8 +442,8 @@ void TimelinePropertyItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *even
QMenu mainMenu; QMenu mainMenu;
QAction *deleteAction = mainMenu.addAction(tr("Remove Property")); QAction *deleteAction = mainMenu.addAction(tr("Remove Property"));
QObject::connect(deleteAction, &QAction::triggered, [this]() { QObject::connect(deleteAction, &QAction::triggered, [this] {
auto deleteKeyframeGroup = [this]() { timelineScene()->deleteKeyframeGroup(m_frames); }; auto deleteKeyframeGroup = [this] { timelineScene()->deleteKeyframeGroup(m_frames); };
QTimer::singleShot(0, deleteKeyframeGroup); QTimer::singleShot(0, deleteKeyframeGroup);
}); });
@@ -627,12 +627,12 @@ void TimelineKeyframeItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *even
{ {
QMenu mainMenu; QMenu mainMenu;
QAction *removeAction = mainMenu.addAction(tr("Delete Keyframe")); QAction *removeAction = mainMenu.addAction(tr("Delete Keyframe"));
QObject::connect(removeAction, &QAction::triggered, [this]() { QObject::connect(removeAction, &QAction::triggered, [this] {
timelineGraphicsScene()->handleKeyframeDeletion(); timelineGraphicsScene()->handleKeyframeDeletion();
}); });
QAction *editEasingAction = mainMenu.addAction(tr("Edit Easing Curve...")); QAction *editEasingAction = mainMenu.addAction(tr("Edit Easing Curve..."));
QObject::connect(editEasingAction, &QAction::triggered, [this]() { QObject::connect(editEasingAction, &QAction::triggered, [this] {
const QList<ModelNode> keys = Utils::transform(abstractScrollGraphicsScene()->selectedKeyframes(), const QList<ModelNode> keys = Utils::transform(abstractScrollGraphicsScene()->selectedKeyframes(),
&TimelineKeyframeItem::m_frame); &TimelineKeyframeItem::m_frame);
@@ -640,7 +640,7 @@ void TimelineKeyframeItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *even
}); });
QAction *editValueAction = mainMenu.addAction(tr("Edit Keyframe...")); QAction *editValueAction = mainMenu.addAction(tr("Edit Keyframe..."));
QObject::connect(editValueAction, &QAction::triggered, [this]() { QObject::connect(editValueAction, &QAction::triggered, [this] {
std::pair<qreal, qreal> timelineRange = {timelineGraphicsScene()->currentTimeline().startKeyframe(), std::pair<qreal, qreal> timelineRange = {timelineGraphicsScene()->currentTimeline().startKeyframe(),
timelineGraphicsScene()->currentTimeline().endKeyframe()}; timelineGraphicsScene()->currentTimeline().endKeyframe()};
editValue(m_frame, timelineRange, propertyItem()->propertyName()); editValue(m_frame, timelineRange, propertyItem()->propertyName());

View File

@@ -361,25 +361,25 @@ void TimelineSectionItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event
QAction *removeAction = mainMenu.addAction( QAction *removeAction = mainMenu.addAction(
TimelineConstants::timelineDeleteKeyframesDisplayName); TimelineConstants::timelineDeleteKeyframesDisplayName);
QObject::connect(removeAction, &QAction::triggered, [this]() { QObject::connect(removeAction, &QAction::triggered, [this] {
timelineScene()->deleteAllKeyframesForTarget(m_targetNode); timelineScene()->deleteAllKeyframesForTarget(m_targetNode);
}); });
QAction *addKeyframesAction = mainMenu.addAction( QAction *addKeyframesAction = mainMenu.addAction(
TimelineConstants::timelineInsertKeyframesDisplayName); TimelineConstants::timelineInsertKeyframesDisplayName);
QObject::connect(addKeyframesAction, &QAction::triggered, [this]() { QObject::connect(addKeyframesAction, &QAction::triggered, [this] {
timelineScene()->insertAllKeyframesForTarget(m_targetNode); timelineScene()->insertAllKeyframesForTarget(m_targetNode);
}); });
QAction *copyAction = mainMenu.addAction( QAction *copyAction = mainMenu.addAction(
TimelineConstants::timelineCopyKeyframesDisplayName); TimelineConstants::timelineCopyKeyframesDisplayName);
QObject::connect(copyAction, &QAction::triggered, [this]() { QObject::connect(copyAction, &QAction::triggered, [this] {
timelineScene()->copyAllKeyframesForTarget(m_targetNode); timelineScene()->copyAllKeyframesForTarget(m_targetNode);
}); });
QAction *pasteAction = mainMenu.addAction( QAction *pasteAction = mainMenu.addAction(
TimelineConstants::timelinePasteKeyframesDisplayName); TimelineConstants::timelinePasteKeyframesDisplayName);
QObject::connect(pasteAction, &QAction::triggered, [this]() { QObject::connect(pasteAction, &QAction::triggered, [this] {
timelineScene()->pasteKeyframesToTarget(m_targetNode); timelineScene()->pasteKeyframesToTarget(m_targetNode);
}); });
@@ -1074,7 +1074,7 @@ void TimelineBarItem::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
QObject::connect(overrideColor, &QAction::triggered, setColor); QObject::connect(overrideColor, &QAction::triggered, setColor);
QAction* resetColor = menu.addAction(tr("Reset Color")); QAction* resetColor = menu.addAction(tr("Reset Color"));
auto reset = [this]() { auto reset = [this] {
ModelNode target = sectionItem()->targetNode(); ModelNode target = sectionItem()->targetNode();
target.removeAuxiliaryData(timelineOverrideColorProperty); target.removeAuxiliaryData(timelineOverrideColorProperty);
}; };

View File

@@ -93,11 +93,11 @@ TimelineSettingsDialog::TimelineSettingsDialog(QWidget *parent, TimelineView *vi
auto *timelineRemoveAction = new QAction(TimelineIcons::REMOVE_TIMELINE.icon(), auto *timelineRemoveAction = new QAction(TimelineIcons::REMOVE_TIMELINE.icon(),
tr("Remove Timeline")); tr("Remove Timeline"));
connect(timelineAddAction, &QAction::triggered, this, [this]() { connect(timelineAddAction, &QAction::triggered, this, [this] {
setupTimelines(m_timelineView->addNewTimeline()); setupTimelines(m_timelineView->addNewTimeline());
}); });
connect(timelineRemoveAction, &QAction::triggered, this, [this]() { connect(timelineRemoveAction, &QAction::triggered, this, [this] {
QmlTimeline timeline = getTimelineFromTabWidget(m_timelineTab); QmlTimeline timeline = getTimelineFromTabWidget(m_timelineTab);
if (timeline.isValid()) { if (timeline.isValid()) {
timeline.destroy(); timeline.destroy();
@@ -119,11 +119,11 @@ TimelineSettingsDialog::TimelineSettingsDialog(QWidget *parent, TimelineView *vi
animationCornerWidget->addAction(animationAddAction); animationCornerWidget->addAction(animationAddAction);
animationCornerWidget->addAction(animationRemoveAction); animationCornerWidget->addAction(animationRemoveAction);
connect(animationAddAction, &QAction::triggered, this, [this]() { connect(animationAddAction, &QAction::triggered, this, [this] {
setupAnimations(m_timelineView->addAnimation(m_currentTimeline)); setupAnimations(m_timelineView->addAnimation(m_currentTimeline));
}); });
connect(animationRemoveAction, &QAction::triggered, this, [this]() { connect(animationRemoveAction, &QAction::triggered, this, [this] {
ModelNode node = getAnimationFromTabWidget(m_animationTab); ModelNode node = getAnimationFromTabWidget(m_animationTab);
if (node.isValid()) { if (node.isValid()) {
node.destroy(); node.destroy();
@@ -156,7 +156,7 @@ TimelineSettingsDialog::TimelineSettingsDialog(QWidget *parent, TimelineView *vi
setupTimelines(QmlTimeline()); setupTimelines(QmlTimeline());
setupAnimations(m_currentTimeline); setupAnimations(m_currentTimeline);
connect(m_timelineTab, &QTabWidget::currentChanged, this, [this]() { connect(m_timelineTab, &QTabWidget::currentChanged, this, [this] {
m_currentTimeline = getTimelineFromTabWidget(m_timelineTab); m_currentTimeline = getTimelineFromTabWidget(m_timelineTab);
setupAnimations(m_currentTimeline); setupAnimations(m_currentTimeline);
}); });

View File

@@ -359,7 +359,7 @@ void TimelineToolBar::createCenterControls()
m_currentFrame = createToolBarLineEdit(this); m_currentFrame = createToolBarLineEdit(this);
addWidget(m_currentFrame); addWidget(m_currentFrame);
auto emitCurrentChanged = [this]() { emit currentFrameChanged(m_currentFrame->text().toInt()); }; auto emitCurrentChanged = [this] { emit currentFrameChanged(m_currentFrame->text().toInt()); };
connect(m_currentFrame, &QLineEdit::editingFinished, emitCurrentChanged); connect(m_currentFrame, &QLineEdit::editingFinished, emitCurrentChanged);
addSeparator(); addSeparator();
@@ -419,7 +419,7 @@ void TimelineToolBar::createRightControls()
m_firstFrame = createToolBarLineEdit(this); m_firstFrame = createToolBarLineEdit(this);
addWidget(m_firstFrame); addWidget(m_firstFrame);
auto emitStartChanged = [this]() { emit startFrameChanged(m_firstFrame->text().toInt()); }; auto emitStartChanged = [this] { emit startFrameChanged(m_firstFrame->text().toInt()); };
connect(m_firstFrame, &QLineEdit::editingFinished, emitStartChanged); connect(m_firstFrame, &QLineEdit::editingFinished, emitStartChanged);
addSeparator(); addSeparator();
@@ -431,7 +431,7 @@ void TimelineToolBar::createRightControls()
tr("Zoom Out"), tr("Zoom Out"),
QKeySequence(QKeySequence::ZoomOut)); QKeySequence(QKeySequence::ZoomOut));
connect(zoomOut, &QAction::triggered, [this]() { connect(zoomOut, &QAction::triggered, [this] {
m_scale->setValue(m_scale->value() - m_scale->pageStep()); m_scale->setValue(m_scale->value() - m_scale->pageStep());
}); });
addAction(zoomOut); addAction(zoomOut);
@@ -458,7 +458,7 @@ void TimelineToolBar::createRightControls()
tr("Zoom In"), tr("Zoom In"),
QKeySequence(QKeySequence::ZoomIn)); QKeySequence(QKeySequence::ZoomIn));
connect(zoomIn, &QAction::triggered, [this]() { connect(zoomIn, &QAction::triggered, [this] {
m_scale->setValue(m_scale->value() + m_scale->pageStep()); m_scale->setValue(m_scale->value() + m_scale->pageStep());
}); });
addAction(zoomIn); addAction(zoomIn);
@@ -470,7 +470,7 @@ void TimelineToolBar::createRightControls()
m_lastFrame = createToolBarLineEdit(this); m_lastFrame = createToolBarLineEdit(this);
addWidget(m_lastFrame); addWidget(m_lastFrame);
auto emitEndChanged = [this]() { emit endFrameChanged(m_lastFrame->text().toInt()); }; auto emitEndChanged = [this] { emit endFrameChanged(m_lastFrame->text().toInt()); };
connect(m_lastFrame, &QLineEdit::editingFinished, emitEndChanged); connect(m_lastFrame, &QLineEdit::editingFinished, emitEndChanged);
addSeparator(); addSeparator();

View File

@@ -24,7 +24,7 @@ TimelineToolButton::TimelineToolButton(QAction *action, QGraphicsItem *parent)
resize(TimelineConstants::toolButtonSize, TimelineConstants::toolButtonSize); resize(TimelineConstants::toolButtonSize, TimelineConstants::toolButtonSize);
setPreferredSize(size()); setPreferredSize(size());
setAcceptHoverEvents(true); setAcceptHoverEvents(true);
connect(action, &QAction::changed, this, [this]() { connect(action, &QAction::changed, this, [this] {
setVisible(m_action->isVisible()); setVisible(m_action->isVisible());
update(); update();
}); });

View File

@@ -238,7 +238,7 @@ TimelineWidget::TimelineWidget(TimelineView *view)
connectToolbar(); connectToolbar();
auto setScrollOffset = [this]() { graphicsScene()->setScrollOffset(m_scrollbar->value()); }; auto setScrollOffset = [this] { graphicsScene()->setScrollOffset(m_scrollbar->value()); };
connect(m_scrollbar, &QSlider::valueChanged, this, setScrollOffset); connect(m_scrollbar, &QSlider::valueChanged, this, setScrollOffset);
connect(graphicsScene(), connect(graphicsScene(),
@@ -246,7 +246,7 @@ TimelineWidget::TimelineWidget(TimelineView *view)
this, this,
[this](const QString &message) { m_statusBar->setText(message); }); [this](const QString &message) { m_statusBar->setText(message); });
connect(m_addButton, &QPushButton::clicked, this, [this]() { connect(m_addButton, &QPushButton::clicked, this, [this] {
m_timelineView->addNewTimelineDialog(); m_timelineView->addNewTimelineDialog();
}); });
@@ -268,9 +268,7 @@ TimelineWidget::TimelineWidget(TimelineView *view)
auto playAnimation = [this](QVariant frame) { graphicsScene()->setCurrentFrame(qRound(frame.toDouble())); }; auto playAnimation = [this](QVariant frame) { graphicsScene()->setCurrentFrame(qRound(frame.toDouble())); };
connect(m_playbackAnimation, &QVariantAnimation::valueChanged, playAnimation); connect(m_playbackAnimation, &QVariantAnimation::valueChanged, playAnimation);
auto updatePlaybackLoopValues = [this]() { auto updatePlaybackLoopValues = [this] { updatePlaybackValues(); };
updatePlaybackValues();
};
connect(graphicsScene()->layoutRuler(), &TimelineRulerSectionItem::playbackLoopValuesChanged, updatePlaybackLoopValues); connect(graphicsScene()->layoutRuler(), &TimelineRulerSectionItem::playbackLoopValuesChanged, updatePlaybackLoopValues);
auto setPlaybackState = [this](QAbstractAnimation::State newState, auto setPlaybackState = [this](QAbstractAnimation::State newState,
@@ -279,7 +277,7 @@ TimelineWidget::TimelineWidget(TimelineView *view)
}; };
connect(m_playbackAnimation, &QVariantAnimation::stateChanged, setPlaybackState); connect(m_playbackAnimation, &QVariantAnimation::stateChanged, setPlaybackState);
auto onFinish = [this]() { graphicsScene()->setCurrentFrame(m_playbackAnimation->startValue().toInt()); }; auto onFinish = [this] { graphicsScene()->setCurrentFrame(m_playbackAnimation->startValue().toInt()); };
connect(m_playbackAnimation, &QVariantAnimation::finished, onFinish); connect(m_playbackAnimation, &QVariantAnimation::finished, onFinish);
TimeLineNS::TimelineScrollAreaSupport::support(m_graphicsView, m_scrollbar); TimeLineNS::TimelineScrollAreaSupport::support(m_graphicsView, m_scrollbar);
@@ -297,22 +295,22 @@ void TimelineWidget::connectToolbar()
auto setZoomFactor = [this](int val) { m_graphicsScene->setZoom(val); }; auto setZoomFactor = [this](int val) { m_graphicsScene->setZoom(val); };
connect(m_toolbar, &TimelineToolBar::scaleFactorChanged, setZoomFactor); connect(m_toolbar, &TimelineToolBar::scaleFactorChanged, setZoomFactor);
auto setToFirstFrame = [this]() { auto setToFirstFrame = [this] {
graphicsScene()->setCurrentFrame(graphicsScene()->startFrame()); graphicsScene()->setCurrentFrame(graphicsScene()->startFrame());
}; };
connect(m_toolbar, &TimelineToolBar::toFirstFrameTriggered, setToFirstFrame); connect(m_toolbar, &TimelineToolBar::toFirstFrameTriggered, setToFirstFrame);
auto setToLastFrame = [this]() { auto setToLastFrame = [this] {
graphicsScene()->setCurrentFrame(graphicsScene()->endFrame()); graphicsScene()->setCurrentFrame(graphicsScene()->endFrame());
}; };
connect(m_toolbar, &TimelineToolBar::toLastFrameTriggered, setToLastFrame); connect(m_toolbar, &TimelineToolBar::toLastFrameTriggered, setToLastFrame);
auto setToPreviousFrame = [this]() { auto setToPreviousFrame = [this] {
graphicsScene()->setCurrentFrame(adjacentFrame(&previous)); graphicsScene()->setCurrentFrame(adjacentFrame(&previous));
}; };
connect(m_toolbar, &TimelineToolBar::previousFrameTriggered, setToPreviousFrame); connect(m_toolbar, &TimelineToolBar::previousFrameTriggered, setToPreviousFrame);
auto setToNextFrame = [this]() { graphicsScene()->setCurrentFrame(adjacentFrame(&next)); }; auto setToNextFrame = [this] { graphicsScene()->setCurrentFrame(adjacentFrame(&next)); };
connect(m_toolbar, &TimelineToolBar::nextFrameTriggered, setToNextFrame); connect(m_toolbar, &TimelineToolBar::nextFrameTriggered, setToNextFrame);
auto setCurrentFrame = [this](int frame) { graphicsScene()->setCurrentFrame(frame); }; auto setCurrentFrame = [this](int frame) { graphicsScene()->setCurrentFrame(frame); };

View File

@@ -139,7 +139,7 @@ WorkspaceModel::WorkspaceModel(QObject *)
if (!dockManager) if (!dockManager)
return false; return false;
connect(dockManager, &ADS::DockManager::workspaceListChanged, this, [this]() { connect(dockManager, &ADS::DockManager::workspaceListChanged, this, [this] {
beginResetModel(); beginResetModel();
endResetModel(); endResetModel();
}); });
@@ -323,7 +323,7 @@ ToolBarBackend::ToolBarBackend(QObject *parent)
auto editorManager = Core::EditorManager::instance(); auto editorManager = Core::EditorManager::instance();
connect(editorManager, &Core::EditorManager::documentClosed, this, [this]() { connect(editorManager, &Core::EditorManager::documentClosed, this, [this] {
if (isInDesignMode() && Core::DocumentModel::entryCount() == 0) { if (isInDesignMode() && Core::DocumentModel::entryCount() == 0) {
QTimer::singleShot(0, QTimer::singleShot(0,
Core::ModeManager::instance(), Core::ModeManager::instance(),
@@ -340,7 +340,7 @@ ToolBarBackend::ToolBarBackend(QObject *parent)
}); });
}); });
connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged, this, [this]() { connect(Core::ModeManager::instance(), &Core::ModeManager::currentModeChanged, this, [this] {
emit isInDesignModeChanged(); emit isInDesignModeChanged();
emit isInEditModeChanged(); emit isInEditModeChanged();
emit isInSessionModeChanged(); emit isInSessionModeChanged();
@@ -381,7 +381,7 @@ void ToolBarBackend::registerDeclarativeType()
void ToolBarBackend::triggerModeChange() void ToolBarBackend::triggerModeChange()
{ {
QmlDesignerPlugin::emitUsageStatistics(Constants::EVENT_TOOLBAR_MODE_CHANGE); QmlDesignerPlugin::emitUsageStatistics(Constants::EVENT_TOOLBAR_MODE_CHANGE);
QTimer::singleShot(0, this, [this]() { //Do not trigger mode change directly from QML QTimer::singleShot(0, this, [this] { //Do not trigger mode change directly from QML
bool qmlFileOpen = false; bool qmlFileOpen = false;
if (!projectOpened()) { if (!projectOpened()) {

View File

@@ -63,7 +63,7 @@ TransitionEditorGraphicsScene::TransitionEditorGraphicsScene(TransitionEditorWid
setSceneRect(m_layout->geometry()); setSceneRect(m_layout->geometry());
connect(m_layout, &QGraphicsWidget::geometryChanged, this, [this]() { connect(m_layout, &QGraphicsWidget::geometryChanged, this, [this] {
auto rect = m_layout->geometry(); auto rect = m_layout->geometry();
setSceneRect(rect); setSceneRect(rect);

View File

@@ -559,7 +559,7 @@ void TransitionEditorBarItem::commitPosition(const QPointF & /*point*/)
if (m_handle != Location::Undefined) { if (m_handle != Location::Undefined) {
sectionItem() sectionItem()
->view() ->view()
->executeInTransaction("TransitionEditorBarItem::commitPosition", [this]() { ->executeInTransaction("TransitionEditorBarItem::commitPosition", [this] {
qreal scaleFactor = rect().width() / m_oldRect.width(); qreal scaleFactor = rect().width() / m_oldRect.width();
qreal moved = (rect().topLeft().x() - m_oldRect.topLeft().x()) / rulerScaling(); qreal moved = (rect().topLeft().x() - m_oldRect.topLeft().x()) / rulerScaling();
@@ -574,7 +574,7 @@ void TransitionEditorBarItem::commitPosition(const QPointF & /*point*/)
if (m_handle != Location::Undefined) { if (m_handle != Location::Undefined) {
propertyItem() propertyItem()
->view() ->view()
->executeInTransaction("TransitionEditorBarItem::commitPosition", [this]() { ->executeInTransaction("TransitionEditorBarItem::commitPosition", [this] {
qreal scaleFactor = rect().width() / m_oldRect.width(); qreal scaleFactor = rect().width() / m_oldRect.width();
qreal moved = (rect().topLeft().x() - m_oldRect.topLeft().x()) / rulerScaling(); qreal moved = (rect().topLeft().x() - m_oldRect.topLeft().x()) / rulerScaling();
qreal supposedFirstFrame = qRound(moved); qreal supposedFirstFrame = qRound(moved);

View File

@@ -71,11 +71,11 @@ TransitionEditorSettingsDialog::TransitionEditorSettingsDialog(QWidget *parent,
auto *transitionRemoveAction = new QAction(TimelineIcons::REMOVE_TIMELINE.icon(), auto *transitionRemoveAction = new QAction(TimelineIcons::REMOVE_TIMELINE.icon(),
tr("Remove Transition")); tr("Remove Transition"));
connect(transitionAddAction, &QAction::triggered, this, [this]() { connect(transitionAddAction, &QAction::triggered, this, [this] {
setupTransitions(m_transitionEditorView->addNewTransition()); setupTransitions(m_transitionEditorView->addNewTransition());
}); });
connect(transitionRemoveAction, &QAction::triggered, this, [this]() { connect(transitionRemoveAction, &QAction::triggered, this, [this] {
if (ModelNode transition = getTransitionFromTabWidget(ui->timelineTab)) { if (ModelNode transition = getTransitionFromTabWidget(ui->timelineTab)) {
transition.destroy(); transition.destroy();
setupTransitions({}); setupTransitions({});
@@ -89,7 +89,7 @@ TransitionEditorSettingsDialog::TransitionEditorSettingsDialog(QWidget *parent,
setupTransitions({}); setupTransitions({});
connect(ui->timelineTab, &QTabWidget::currentChanged, this, [this]() { connect(ui->timelineTab, &QTabWidget::currentChanged, this, [this] {
m_currentTransition = getTransitionFromTabWidget(ui->timelineTab); m_currentTransition = getTransitionFromTabWidget(ui->timelineTab);
}); });
} }

View File

@@ -182,7 +182,7 @@ void TransitionEditorToolBar::createLeftControls()
m_transitionComboBox = new QComboBox(this); m_transitionComboBox = new QComboBox(this);
addWidgetToGroup(m_transitionComboBox); addWidgetToGroup(m_transitionComboBox);
connect(m_transitionComboBox, &QComboBox::currentTextChanged, this, [this]() { connect(m_transitionComboBox, &QComboBox::currentTextChanged, this, [this] {
emit currentTransitionChanged(m_transitionComboBox->currentText()); emit currentTransitionChanged(m_transitionComboBox->currentText());
}); });
} }
@@ -242,7 +242,7 @@ void TransitionEditorToolBar::createRightControls()
tr("Zoom Out"), tr("Zoom Out"),
QKeySequence(QKeySequence::ZoomOut)); QKeySequence(QKeySequence::ZoomOut));
connect(zoomOut, &QAction::triggered, [this]() { connect(zoomOut, &QAction::triggered, [this] {
m_scale->setValue(m_scale->value() - m_scale->pageStep()); m_scale->setValue(m_scale->value() - m_scale->pageStep());
}); });
addAction(zoomOut); addAction(zoomOut);
@@ -269,7 +269,7 @@ void TransitionEditorToolBar::createRightControls()
tr("Zoom In"), tr("Zoom In"),
QKeySequence(QKeySequence::ZoomIn)); QKeySequence(QKeySequence::ZoomIn));
connect(zoomIn, &QAction::triggered, [this]() { connect(zoomIn, &QAction::triggered, [this] {
m_scale->setValue(m_scale->value() + m_scale->pageStep()); m_scale->setValue(m_scale->value() + m_scale->pageStep());
}); });
addAction(zoomIn); addAction(zoomIn);
@@ -281,7 +281,7 @@ void TransitionEditorToolBar::createRightControls()
m_duration = createToolBarLineEdit(this); m_duration = createToolBarLineEdit(this);
addWidget(m_duration); addWidget(m_duration);
auto emitEndChanged = [this]() { emit durationChanged(m_duration->text().toInt()); }; auto emitEndChanged = [this] { emit durationChanged(m_duration->text().toInt()); };
connect(m_duration, &QLineEdit::editingFinished, emitEndChanged); connect(m_duration, &QLineEdit::editingFinished, emitEndChanged);
addSpacing(5); addSpacing(5);

View File

@@ -198,7 +198,7 @@ TransitionEditorWidget::TransitionEditorWidget(TransitionEditorView *view)
connectToolbar(); connectToolbar();
auto setScrollOffset = [this]() { graphicsScene()->setScrollOffset(m_scrollbar->value()); }; auto setScrollOffset = [this] { graphicsScene()->setScrollOffset(m_scrollbar->value()); };
connect(m_scrollbar, &QSlider::valueChanged, this, setScrollOffset); connect(m_scrollbar, &QSlider::valueChanged, this, setScrollOffset);
connect(graphicsScene(), connect(graphicsScene(),
@@ -206,7 +206,7 @@ TransitionEditorWidget::TransitionEditorWidget(TransitionEditorView *view)
this, this,
[this](const QString &message) { m_statusBar->setText(message); }); [this](const QString &message) { m_statusBar->setText(message); });
connect(m_addButton, &QPushButton::clicked, this, [this]() { connect(m_addButton, &QPushButton::clicked, this, [this] {
m_transitionEditorView->addNewTransition(); m_transitionEditorView->addNewTransition();
}); });

View File

@@ -27,7 +27,7 @@ TransitionForm::TransitionForm(QWidget *parent)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->idLineEdit, &QLineEdit::editingFinished, [this]() { connect(ui->idLineEdit, &QLineEdit::editingFinished, [this] {
QTC_ASSERT(m_transition.isValid(), return ); QTC_ASSERT(m_transition.isValid(), return );
static QString lastString; static QString lastString;
@@ -62,7 +62,7 @@ TransitionForm::TransitionForm(QWidget *parent)
} }
}); });
connect(ui->listWidgetTo, &QListWidget::itemChanged, this, [this]() { connect(ui->listWidgetTo, &QListWidget::itemChanged, this, [this] {
QTC_ASSERT(m_transition.isValid(), return ); QTC_ASSERT(m_transition.isValid(), return );
const QmlItemNode root(m_transition.view()->rootModelNode()); const QmlItemNode root(m_transition.view()->rootModelNode());
QTC_ASSERT(root.isValid(), return ); QTC_ASSERT(root.isValid(), return );
@@ -86,7 +86,7 @@ TransitionForm::TransitionForm(QWidget *parent)
}); });
}); });
connect(ui->listWidgetFrom, &QListWidget::itemChanged, this, [this]() { connect(ui->listWidgetFrom, &QListWidget::itemChanged, this, [this] {
QTC_ASSERT(m_transition.isValid(), return ); QTC_ASSERT(m_transition.isValid(), return );
const QmlItemNode root(m_transition.view()->rootModelNode()); const QmlItemNode root(m_transition.view()->rootModelNode());
QTC_ASSERT(root.isValid(), return ); QTC_ASSERT(root.isValid(), return );

View File

@@ -491,7 +491,7 @@ void DesignModeWidget::aboutToShowWorkspaces()
}); });
QAction *resetWorkspace = menu->addAction(tr("Reset Active")); QAction *resetWorkspace = menu->addAction(tr("Reset Active"));
connect(resetWorkspace, &QAction::triggered, this, [this]() { connect(resetWorkspace, &QAction::triggered, this, [this] {
if (m_dockManager->resetWorkspacePreset(m_dockManager->activeWorkspace()->fileName())) if (m_dockManager->resetWorkspacePreset(m_dockManager->activeWorkspace()->fileName()))
m_dockManager->reloadActiveWorkspace(); m_dockManager->reloadActiveWorkspace();
}); });

View File

@@ -499,7 +499,7 @@ void QmlDesignerProjectManager::generatePreview()
QmlDesignerProjectManager::ImageCacheData *QmlDesignerProjectManager::imageCacheData() QmlDesignerProjectManager::ImageCacheData *QmlDesignerProjectManager::imageCacheData()
{ {
std::call_once(imageCacheFlag, [this]() { std::call_once(imageCacheFlag, [this] {
m_imageCacheData = std::make_unique<ImageCacheData>(m_externalDependencies); m_imageCacheData = std::make_unique<ImageCacheData>(m_externalDependencies);
auto setTargetInImageCache = auto setTargetInImageCache =
[imageCacheData = m_imageCacheData.get()](ProjectExplorer::Target *target) { [imageCacheData = m_imageCacheData.get()](ProjectExplorer::Target *target) {

View File

@@ -16,12 +16,12 @@ namespace QmlDesigner {
FileDownloader::FileDownloader(QObject *parent) FileDownloader::FileDownloader(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
QObject::connect(this, &FileDownloader::downloadFailed, this, [this]() { QObject::connect(this, &FileDownloader::downloadFailed, this, [this] {
if (m_outputFile.exists()) if (m_outputFile.exists())
m_outputFile.remove(); m_outputFile.remove();
}); });
QObject::connect(this, &FileDownloader::downloadCanceled, this, [this]() { QObject::connect(this, &FileDownloader::downloadCanceled, this, [this] {
if (m_outputFile.exists()) if (m_outputFile.exists())
m_outputFile.remove(); m_outputFile.remove();
}); });

View File

@@ -16,30 +16,30 @@ void MultiFileDownloader::setDownloader(FileDownloader *downloader)
{ {
m_downloader = downloader; m_downloader = downloader;
QObject::connect(this, &MultiFileDownloader::downloadStarting, [this]() { QObject::connect(this, &MultiFileDownloader::downloadStarting, [this] {
m_nextFile = 0; m_nextFile = 0;
if (m_files.length() > 0) if (m_files.length() > 0)
m_downloader->start(); m_downloader->start();
}); });
QObject::connect(m_downloader, &FileDownloader::progressChanged, this, [this]() { QObject::connect(m_downloader, &FileDownloader::progressChanged, this, [this] {
double curProgress = m_downloader->progress() / 100.0; double curProgress = m_downloader->progress() / 100.0;
double totalProgress = (m_nextFile + curProgress) / m_files.size(); double totalProgress = (m_nextFile + curProgress) / m_files.size();
m_progress = totalProgress * 100; m_progress = totalProgress * 100;
emit progressChanged(); emit progressChanged();
}); });
QObject::connect(m_downloader, &FileDownloader::downloadFailed, this, [this]() { QObject::connect(m_downloader, &FileDownloader::downloadFailed, this, [this] {
m_failed = true; m_failed = true;
emit downloadFailed(); emit downloadFailed();
}); });
QObject::connect(m_downloader, &FileDownloader::downloadCanceled, this, [this]() { QObject::connect(m_downloader, &FileDownloader::downloadCanceled, this, [this] {
m_canceled = true; m_canceled = true;
emit downloadCanceled(); emit downloadCanceled();
}); });
QObject::connect(m_downloader, &FileDownloader::finishedChanged, this, [this]() { QObject::connect(m_downloader, &FileDownloader::finishedChanged, this, [this] {
switchToNextFile(); switchToNextFile();
}); });
} }

View File

@@ -122,7 +122,7 @@ StudioSettingsPage::StudioSettingsPage()
m_pathChooserExamples->setFilePath(Utils::FilePath::fromString(Paths::examplesPathSetting())); m_pathChooserExamples->setFilePath(Utils::FilePath::fromString(Paths::examplesPathSetting()));
auto examplesResetButton = new QPushButton(tr("Reset Path")); auto examplesResetButton = new QPushButton(tr("Reset Path"));
connect(examplesResetButton, &QPushButton::clicked, this, [this]() { connect(examplesResetButton, &QPushButton::clicked, this, [this] {
m_pathChooserExamples->setFilePath(Paths::defaultExamplesPath()); m_pathChooserExamples->setFilePath(Paths::defaultExamplesPath());
}); });
@@ -141,7 +141,7 @@ StudioSettingsPage::StudioSettingsPage()
m_pathChooserBundles->setFilePath(Utils::FilePath::fromString(Paths::bundlesPathSetting())); m_pathChooserBundles->setFilePath(Utils::FilePath::fromString(Paths::bundlesPathSetting()));
QPushButton *bundlesResetButton = new QPushButton(tr("Reset Path")); QPushButton *bundlesResetButton = new QPushButton(tr("Reset Path"));
connect(bundlesResetButton, &QPushButton::clicked, this, [this]() { connect(bundlesResetButton, &QPushButton::clicked, this, [this] {
m_pathChooserBundles->setFilePath(Paths::defaultBundlesPath()); m_pathChooserBundles->setFilePath(Paths::defaultBundlesPath());
}); });

View File

@@ -131,11 +131,11 @@ void QmlJSOutlineWidget::setEditor(QmlJSEditorWidget *editor)
m_filterModel->setSourceModel(m_editor->qmlJsEditorDocument()->outlineModel()); m_filterModel->setSourceModel(m_editor->qmlJsEditorDocument()->outlineModel());
m_treeView->expandAll(); m_treeView->expandAll();
connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelAboutToBeReset, m_treeView, [this]() { connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelAboutToBeReset, m_treeView, [this] {
if (m_treeView->selectionModel()) if (m_treeView->selectionModel())
m_treeView->selectionModel()->blockSignals(true); m_treeView->selectionModel()->blockSignals(true);
}); });
connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelReset, m_treeView, [this]() { connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QAbstractItemModel::modelReset, m_treeView, [this] {
if (m_treeView->selectionModel()) if (m_treeView->selectionModel())
m_treeView->selectionModel()->blockSignals(false); m_treeView->selectionModel()->blockSignals(false);
}); });

View File

@@ -160,7 +160,7 @@ QmlPreviewPluginPrivate::QmlPreviewPluginPrivate(QmlPreviewPlugin *parent)
action->setEnabled(ProjectManager::startupProject() != nullptr); action->setEnabled(ProjectManager::startupProject() != nullptr);
connect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, action, connect(ProjectManager::instance(), &ProjectManager::startupProjectChanged, action,
&QAction::setEnabled); &QAction::setEnabled);
connect(action, &QAction::triggered, this, [this]() { connect(action, &QAction::triggered, this, [this] {
if (auto multiLanguageAspect = QmlProjectManager::QmlMultiLanguageAspect::current()) if (auto multiLanguageAspect = QmlProjectManager::QmlMultiLanguageAspect::current())
m_localeIsoCode = multiLanguageAspect->currentLocale(); m_localeIsoCode = multiLanguageAspect->currentLocale();
bool skipDeploy = false; bool skipDeploy = false;

View File

@@ -91,11 +91,11 @@ void QmlProfilerClientManager::createClients()
m_clientPlugin.data(), &QmlProfilerTraceClient::setRecording); m_clientPlugin.data(), &QmlProfilerTraceClient::setRecording);
QObject::connect(this, &QmlDebug::QmlDebugConnectionManager::connectionOpened, QObject::connect(this, &QmlDebug::QmlDebugConnectionManager::connectionOpened,
m_clientPlugin.data(), [this]() { m_clientPlugin.data(), [this] {
m_clientPlugin->setRecording(m_profilerState->clientRecording()); m_clientPlugin->setRecording(m_profilerState->clientRecording());
}); });
QObject::connect(this, &QmlDebug::QmlDebugConnectionManager::connectionClosed, QObject::connect(this, &QmlDebug::QmlDebugConnectionManager::connectionClosed,
m_clientPlugin.data(), [this]() { m_clientPlugin.data(), [this] {
m_profilerState->setServerRecording(false); m_profilerState->setServerRecording(false);
}); });
} }

View File

@@ -86,7 +86,7 @@ void QmlProfilerStatisticsModel::restrictToFeatures(quint64 features)
m_modelManager->replayQmlEvents(filter(std::bind(&QmlProfilerStatisticsModel::loadEvent, this, m_modelManager->replayQmlEvents(filter(std::bind(&QmlProfilerStatisticsModel::loadEvent, this,
std::placeholders::_1, std::placeholders::_2)), std::placeholders::_1, std::placeholders::_2)),
std::bind(&QmlProfilerStatisticsModel::beginResetModel, this), std::bind(&QmlProfilerStatisticsModel::beginResetModel, this),
[this]() { [this] {
finalize(); finalize();
notesChanged(QmlProfilerStatisticsModel::s_invalidTypeId); // Reload notes notesChanged(QmlProfilerStatisticsModel::s_invalidTypeId); // Reload notes
}, [this](const QString &message) { }, [this](const QString &message) {

View File

@@ -188,7 +188,7 @@ QmlProfilerTool::QmlProfilerTool()
d->m_searchButton->setEnabled(false); d->m_searchButton->setEnabled(false);
connect(d->m_searchButton, &QToolButton::clicked, this, &QmlProfilerTool::showTimeLineSearch); connect(d->m_searchButton, &QToolButton::clicked, this, &QmlProfilerTool::showTimeLineSearch);
connect(d->m_viewContainer, &QmlProfilerViewManager::viewsCreated, this, [this]() { connect(d->m_viewContainer, &QmlProfilerViewManager::viewsCreated, this, [this] {
d->m_searchButton->setEnabled(d->m_viewContainer->traceView()->isUsable()); d->m_searchButton->setEnabled(d->m_viewContainer->traceView()->isUsable());
}); });
@@ -241,7 +241,7 @@ QmlProfilerTool::QmlProfilerTool()
}); });
} }
auto updateRecordButton = [this]() { auto updateRecordButton = [this] {
const bool recording = const bool recording =
d->m_profilerState->currentState() != QmlProfilerStateManager::AppRunning d->m_profilerState->currentState() != QmlProfilerStateManager::AppRunning
? d->m_profilerState->clientRecording() : d->m_profilerState->serverRecording(); ? d->m_profilerState->clientRecording() : d->m_profilerState->serverRecording();
@@ -738,7 +738,7 @@ void QmlProfilerTool::clientsDisconnected()
// ... and return to the "base" state // ... and return to the "base" state
if (d->m_profilerState->currentState() == QmlProfilerStateManager::AppDying) { if (d->m_profilerState->currentState() == QmlProfilerStateManager::AppDying) {
QTimer::singleShot(0, d->m_profilerState, [this]() { QTimer::singleShot(0, d->m_profilerState, [this] {
d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle); d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle);
}); });
} }
@@ -855,7 +855,7 @@ void QmlProfilerTool::profilerStateChanged()
d->m_profilerConnections->stopRecording(); d->m_profilerConnections->stopRecording();
} else { } else {
// Directly transition to idle // Directly transition to idle
QTimer::singleShot(0, d->m_profilerState, [this]() { QTimer::singleShot(0, d->m_profilerState, [this] {
d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle); d->m_profilerState->setCurrentState(QmlProfilerStateManager::Idle);
}); });
} }

View File

@@ -74,7 +74,7 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag
setObjectName("QmlProfiler.Timeline.Dock"); setObjectName("QmlProfiler.Timeline.Dock");
d->m_zoomControl = new Timeline::TimelineZoomControl(this); d->m_zoomControl = new Timeline::TimelineZoomControl(this);
modelManager->registerFeatures(0, QmlProfilerModelManager::QmlEventLoader(), [this]() { modelManager->registerFeatures(0, QmlProfilerModelManager::QmlEventLoader(), [this] {
if (d->m_suspendedModels.isEmpty()) { if (d->m_suspendedModels.isEmpty()) {
// Temporarily remove the models, while we're changing them // Temporarily remove the models, while we're changing them
d->m_suspendedModels = d->m_modelProxy->models(); d->m_suspendedModels = d->m_modelProxy->models();
@@ -90,7 +90,7 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag
d->m_zoomControl->setRange(start, start + (end - start) / 10); d->m_zoomControl->setRange(start, start + (end - start) / 10);
d->m_modelProxy->setModels(d->m_suspendedModels); d->m_modelProxy->setModels(d->m_suspendedModels);
d->m_suspendedModels.clear(); d->m_suspendedModels.clear();
}, [this]() { }, [this] {
d->m_zoomControl->clear(); d->m_zoomControl->clear();
if (!d->m_suspendedModels.isEmpty()) { if (!d->m_suspendedModels.isEmpty()) {
d->m_modelProxy->setModels(d->m_suspendedModels); d->m_modelProxy->setModels(d->m_suspendedModels);

View File

@@ -87,7 +87,7 @@ QmlBuildSystem::QmlBuildSystem(Target *target)
refresh(RefreshOptions::NoFileRefresh); refresh(RefreshOptions::NoFileRefresh);
updateMcuBuildStep(target, qtForMCUs()); updateMcuBuildStep(target, qtForMCUs());
}); });
connect(target->project(), &Project::projectFileIsDirty, this, [this]() { connect(target->project(), &Project::projectFileIsDirty, this, [this] {
refresh(RefreshOptions::Project); refresh(RefreshOptions::Project);
updateMcuBuildStep(project()->activeTarget(), qtForMCUs()); updateMcuBuildStep(project()->activeTarget(), qtForMCUs());
}); });

View File

@@ -211,7 +211,7 @@ FilePath QmlProjectRunConfiguration::qmlRuntimeFilePath() const
if (!qmlRuntime.isEmpty()) if (!qmlRuntime.isEmpty())
return qmlRuntime; return qmlRuntime;
} }
auto hasDeployStep = [this]() { auto hasDeployStep = [this] {
return target()->activeDeployConfiguration() && return target()->activeDeployConfiguration() &&
!target()->activeDeployConfiguration()->stepList()->isEmpty(); !target()->activeDeployConfiguration()->stepList()->isEmpty();
}; };

View File

@@ -80,7 +80,7 @@ ResourceEditorW::ResourceEditorW(const Core::Context &context,
connect(m_resourceEditor, &QrcEditor::itemActivated, connect(m_resourceEditor, &QrcEditor::itemActivated,
this, &ResourceEditorW::openFile); this, &ResourceEditorW::openFile);
connect(m_resourceEditor->commandHistory(), &QUndoStack::indexChanged, connect(m_resourceEditor->commandHistory(), &QUndoStack::indexChanged,
m_resourceDocument, [this]() { m_resourceDocument->setShouldAutoSave(true); }); m_resourceDocument, [this] { m_resourceDocument->setShouldAutoSave(true); });
if (debugResourceEditorW) if (debugResourceEditorW)
qDebug() << "ResourceEditorW::ResourceEditorW()"; qDebug() << "ResourceEditorW::ResourceEditorW()";
} }

View File

@@ -541,7 +541,7 @@ TrimWidget::TrimWidget(const ClipInfo &clip, QWidget *parent)
noMargin(), noMargin(),
}.attachTo(this); }.attachTo(this);
connect(m_frameSlider, &QSlider::valueChanged, this, [this]() { connect(m_frameSlider, &QSlider::valueChanged, this, [this] {
m_currentTime->setFrame(currentFrame()); m_currentTime->setFrame(currentFrame());
updateTrimWidgets(); updateTrimWidgets();
emit positionChanged(); emit positionChanged();

View File

@@ -41,7 +41,7 @@ NavigatorSlider::NavigatorSlider(QWidget *parent)
connect(zoomOut, &QToolButton::clicked, this, &NavigatorSlider::zoomOut); connect(zoomOut, &QToolButton::clicked, this, &NavigatorSlider::zoomOut);
connect(zoomIn, &QToolButton::clicked, this, &NavigatorSlider::zoomIn); connect(zoomIn, &QToolButton::clicked, this, &NavigatorSlider::zoomIn);
connect(m_slider, &QSlider::valueChanged, this, [=](int newValue){ connect(m_slider, &QSlider::valueChanged, this, [this](int newValue) {
emit valueChanged(newValue); emit valueChanged(newValue);
}); });
} }

View File

@@ -885,7 +885,7 @@ void GraphicsScene::addChild(BaseItem *item)
{ {
if (!m_baseItems.contains(item)) { if (!m_baseItems.contains(item)) {
connect(item, &BaseItem::selectedStateChanged, this, &GraphicsScene::selectionChanged); connect(item, &BaseItem::selectedStateChanged, this, &GraphicsScene::selectionChanged);
connect(item, &BaseItem::openToDifferentView, this, [=](BaseItem *item){ connect(item, &BaseItem::openToDifferentView, this, [this](BaseItem *item) {
emit openStateView(item); emit openStateView(item);
}, Qt::QueuedConnection); }, Qt::QueuedConnection);
m_baseItems << item; m_baseItems << item;

View File

@@ -43,7 +43,7 @@ StateItem::StateItem(const QPointF &pos, BaseItem *parent)
checkWarningItems(); checkWarningItems();
connect(m_stateNameItem, &TextItem::selected, this, [=](bool sel){ connect(m_stateNameItem, &TextItem::selected, this, [this](bool sel) {
setItemSelected(sel); setItemSelected(sel);
}); });
connect(m_stateNameItem, &TextItem::textChanged, this, &StateItem::updateTextPositions); connect(m_stateNameItem, &TextItem::textChanged, this, &StateItem::updateTextPositions);

View File

@@ -50,7 +50,7 @@ TransitionItem::TransitionItem(BaseItem *parent)
<< QPointF(0, 1); << QPointF(0, 1);
m_eventTagItem = new TagTextItem(this); m_eventTagItem = new TagTextItem(this);
connect(m_eventTagItem, &TagTextItem::selected, this, [=](bool sel){ connect(m_eventTagItem, &TagTextItem::selected, this, [this](bool sel) {
setItemSelected(sel); setItemSelected(sel);
}); });
connect(m_eventTagItem, &TagTextItem::textReady, this, &TransitionItem::textHasChanged); connect(m_eventTagItem, &TagTextItem::textReady, this, &TransitionItem::textHasChanged);

View File

@@ -115,7 +115,7 @@ DataModelDownloader::DataModelDownloader(QObject * /* parent */)
&DataModelDownloader::targetPathMustChange); &DataModelDownloader::targetPathMustChange);
} }
connect(&m_fileDownloader, &QmlDesigner::FileDownloader::finishedChanged, this, [this]() { connect(&m_fileDownloader, &QmlDesigner::FileDownloader::finishedChanged, this, [this] {
m_started = false; m_started = false;
if (m_fileDownloader.finished()) { if (m_fileDownloader.finished()) {

View File

@@ -94,7 +94,7 @@ QdsNewDialog::QdsNewDialog(QWidget *parent)
deleteLater(); deleteLater();
}); });
QObject::connect(m_styleModel.data(), &StyleModel::modelAboutToBeReset, this, [this]() { QObject::connect(m_styleModel.data(), &StyleModel::modelAboutToBeReset, this, [this] {
m_qmlStyleIndex = -1; m_qmlStyleIndex = -1;
}); });
} }

View File

@@ -509,7 +509,7 @@ void ProjectModel::resetProjects()
void ProjectModel::delayedResetProjects() void ProjectModel::delayedResetProjects()
{ {
QTimer::singleShot(2000, this, [this]() { QTimer::singleShot(2000, this, [this] {
beginResetModel(); beginResetModel();
endResetModel(); endResetModel();
m_blockOpenRecent = false; m_blockOpenRecent = false;
@@ -768,7 +768,7 @@ WelcomeMode::WelcomeMode()
m_modeWidget->layout()->addWidget(m_quickWidget); m_modeWidget->layout()->addWidget(m_quickWidget);
}); });
connect(m_dataModelDownloader, &DataModelDownloader::downloadFailed, this, [this]() { connect(m_dataModelDownloader, &DataModelDownloader::downloadFailed, this, [this] {
m_quickWidget->setEnabled(true); m_quickWidget->setEnabled(true);
}); });

View File

@@ -145,7 +145,7 @@ void TerminalWidget::setupPty()
if (m_shellIntegration) if (m_shellIntegration)
m_shellIntegration->prepareProcess(*m_process.get()); m_shellIntegration->prepareProcess(*m_process.get());
connect(m_process.get(), &Process::readyReadStandardOutput, this, [this]() { connect(m_process.get(), &Process::readyReadStandardOutput, this, [this] {
onReadyRead(false); onReadyRead(false);
}); });

View File

@@ -31,7 +31,7 @@ LocatorMatcherTasks BookmarkFilter::matchers()
Storage<LocatorStorage> storage; Storage<LocatorStorage> storage;
const auto onSetup = [=] { storage->reportOutput(match(storage->input())); }; const auto onSetup = [this, storage] { storage->reportOutput(match(storage->input())); };
return {{Sync(onSetup), storage}}; return {{Sync(onSetup), storage}};
} }

View File

@@ -154,7 +154,7 @@ QWidget *FindInFiles::createConfigWidget()
for (const QString &dir: legacyHistory) for (const QString &dir: legacyHistory)
completer->addEntry(dir); completer->addEntry(dir);
} }
m_directory->addButton("Current", this, [this]() { m_directory->addButton("Current", this, [this] {
const IDocument *document = EditorManager::instance()->currentDocument(); const IDocument *document = EditorManager::instance()->currentDocument();
if (!document) if (!document)
return; return;

Some files were not shown because too many files have changed in this diff Show More