From 251e1cca4c9dbb69e708aaf31397a6dc74556db0 Mon Sep 17 00:00:00 2001 From: Ali Kianian Date: Tue, 12 Sep 2023 09:40:16 +0300 Subject: [PATCH] QmlDesigner: Make shortcut accessible from the MenuItem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shortcut property is accessible directly for the MenuItem. Change-Id: I6d956859411a02dcd9c9610cfa4ccffb2e7867e7 Reviewed-by: Henning Gründl Reviewed-by: Mahmoud Badri Reviewed-by: Qt CI Patch Build Bot Reviewed-by: --- .../imports/StudioControls/MenuItem.qml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItem.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItem.qml index 16a76c2e640..07265e41a73 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItem.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItem.qml @@ -9,6 +9,8 @@ import StudioTheme 1.0 as StudioTheme T.MenuItem { id: control + property alias shortcut: itemAction.shortcut + property StudioTheme.ControlStyle style: StudioTheme.Values.controlStyle property int labelSpacing: control.style.contextMenuLabelSpacing @@ -22,7 +24,9 @@ T.MenuItem { padding: 0 spacing: 0 horizontalPadding: control.style.contextMenuHorizontalPadding - action: Action {} + action: Action { + id: itemAction + } contentItem: Item { Text { @@ -39,14 +43,14 @@ T.MenuItem { id: shortcutLabel anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - text: shortcut.nativeText + text: shortcutObserver.nativeText font: control.font color: textLabel.color Shortcut { - id: shortcut - property int shortcutWorkaround: control.action.shortcut ?? 0 - sequence: shortcut.shortcutWorkaround + id: shortcutObserver + property int shortcutWorkaround: control.shortcut ?? 0 + sequence: shortcutObserver.shortcutWorkaround } } }