aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickmenu_p_p.h
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2019-01-28 13:14:30 +0100
committerMitch Curtis <mitch.curtis@qt.io>2019-02-04 14:53:39 +0000
commit763b51d494b708790acc3c3f797313f29d09976b (patch)
tree65f5dba1a2d0ead6b3e3259b14bc5ddedc12484a /src/quicktemplates2/qquickmenu_p_p.h
parent32f05c5f5f5a580af0e0fe0964d71cf498ce391b (diff)
Menu: fix disabled sub-menu items being highlighted
When a menu item with a sub-menu was triggered by key or mouse, it would open the sub-menu with the first menu item highlighted. This doesn't make sense for disabled menu items, so this patch makes it find the first enabled item. Change-Id: I9df1c750749e5a77b027b6f476b8ae1f5ea035bd Fixes: QTBUG-69540 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickmenu_p_p.h')
-rw-r--r--src/quicktemplates2/qquickmenu_p_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickmenu_p_p.h b/src/quicktemplates2/qquickmenu_p_p.h
index 6146b96039..ec48c919da 100644
--- a/src/quicktemplates2/qquickmenu_p_p.h
+++ b/src/quicktemplates2/qquickmenu_p_p.h
@@ -115,6 +115,8 @@ public:
bool activateNextItem();
bool activatePreviousItem();
+ QQuickMenuItem *firstEnabledMenuItem() const;
+
static void contentData_append(QQmlListProperty<QObject> *prop, QObject *obj);
static int contentData_count(QQmlListProperty<QObject> *prop);
static QObject *contentData_at(QQmlListProperty<QObject> *prop, int index);