From 14d21f4f2cf0926ae9423450d646f5c21bdc3bdd Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 23 Aug 2023 13:12:02 +0200 Subject: [PATCH] Designer plugin: Simplify connections Connect to members instead of using lambdas. Amends 93de403391b59acf90fbe7319a059382dfe458a6. Change-Id: I401f550ee3f2e3a12086b064f698ec2fc8b5aca6 Reviewed-by: Reviewed-by: Jarek Kobus --- src/plugins/designer/formeditor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/designer/formeditor.cpp b/src/plugins/designer/formeditor.cpp index 93603e1a28e..436a8ca765f 100644 --- a/src/plugins/designer/formeditor.cpp +++ b/src/plugins/designer/formeditor.cpp @@ -519,7 +519,7 @@ void FormEditorData::setupActions() m_actionPrint = new QAction(this); bindShortcut(ActionManager::registerAction(m_actionPrint, Core::Constants::PRINT, m_contexts), m_actionPrint); - QObject::connect(m_actionPrint, &QAction::triggered, this, [this] { print(); }); + connect(m_actionPrint, &QAction::triggered, this, &FormEditorData::print); //'delete' action. Do not set a shortcut as Designer handles // the 'Delete' key by event filter. Setting a shortcut triggers @@ -771,7 +771,8 @@ IEditor *FormEditorData::createEditor() QDesignerFormWindowInterface *form = m_fwm->createFormWindow(nullptr); QTC_ASSERT(form, return nullptr); form->setPalette(Theme::initialPalette()); - QObject::connect(form, &QDesignerFormWindowInterface::toolChanged, this, [this](int i) { toolChanged(i); }); + connect(form, &QDesignerFormWindowInterface::toolChanged, + this, &FormEditorData::toolChanged); auto widgetHost = new SharedTools::WidgetHost( /* parent */ nullptr, form); FormWindowEditor *formWindowEditor = m_xmlEditorFactory->create(form);