summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-09-06 10:16:23 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-06 10:37:12 +0200
commit5520918af2cfb00618765820df2a28916a12c626 (patch)
treed50cdfef55bc57391ef1fa6a1d36e945578120bf
parent9548940ced977afe6949121ae106154320f6a0b1 (diff)
downloadqtquickcontrols-5520918af2cfb00618765820df2a28916a12c626.tar.gz
Set the menu role for the QPlatformMenuItem to the default
QAction has a default menu role which is passed on to the QPlatformMenuItem. But as QtQuickControls does not use QAction, we need to set the default menu role explicitly to TextHeuristicRole. This fixes the merging of menu items on Mac. Task-number: QTBUG-31883 Change-Id: I24f0e265f8ceca376db9970d62e8f79a646fef3b Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r--src/controls/qquickmenuitem.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/controls/qquickmenuitem.cpp b/src/controls/qquickmenuitem.cpp
index ed03b336..2fda7e00 100644
--- a/src/controls/qquickmenuitem.cpp
+++ b/src/controls/qquickmenuitem.cpp
@@ -55,6 +55,8 @@ QQuickMenuBase::QQuickMenuBase(QObject *parent)
: QObject(parent), m_visible(true), m_parentMenu(0), m_container(0), m_visualItem(0)
{
m_platformItem = QGuiApplicationPrivate::platformTheme()->createPlatformMenuItem();
+ if (m_platformItem)
+ m_platformItem->setRole(QPlatformMenuItem::TextHeuristicRole);
}
QQuickMenuBase::~QQuickMenuBase()