From 07d8df77a1de2673cb9ae63ae20cda06449750d7 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Fri, 24 Feb 2017 13:20:21 +0000 Subject: [PATCH] Connect all connections to action in QMenuItem::setAction Summary: Otherwise if anyone used setAction it would be missing a very important connect. Test Plan: Compiled Reviewers: #plasma Subscribers: plasma-devel, #frameworks Tags: #plasma, #frameworks Differential Revision: https://phabricator.kde.org/D4758 --- src/declarativeimports/plasmacomponents/qmenuitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarativeimports/plasmacomponents/qmenuitem.cpp b/src/declarativeimports/plasmacomponents/qmenuitem.cpp index 7b89948f2..b91eb029a 100644 --- a/src/declarativeimports/plasmacomponents/qmenuitem.cpp +++ b/src/declarativeimports/plasmacomponents/qmenuitem.cpp @@ -26,7 +26,6 @@ QMenuItem::QMenuItem(QQuickItem *parent) m_section(false) { setAction(new QAction(this)); - connect(m_action, &QAction::triggered, this, &QMenuItem::clicked); } QAction *QMenuItem::action() const @@ -44,6 +43,7 @@ void QMenuItem::setAction(QAction *a) connect(m_action, &QAction::changed, this, &QMenuItem::textChanged); connect(m_action, &QAction::changed, this, &QMenuItem::checkableChanged); connect(m_action, SIGNAL(toggled(bool)), this, SIGNAL(toggled(bool))); + connect(m_action, &QAction::triggered, this, &QMenuItem::clicked); connect(this, &QQuickItem::visibleChanged, this, &QMenuItem::updateAction); connect(this, &QQuickItem::enabledChanged, this, &QMenuItem::updateAction);