QmlDesigner: Use MenuItem instead of Action

This avoids conflicts with shortcuts.

Task-number: QDS-803
Change-Id: I9269729cf2cb4a6bba9493d768c595748af3392d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Thomas Hartmann
2019-06-14 13:16:13 +02:00
parent 75a2cae723
commit 1dae4593cc

View File

@@ -47,32 +47,32 @@ Menu {
MenuSeparator { MenuSeparator {
} }
Controls2.Action { Controls2.MenuItem {
text: "Copy" text: "Copy"
enabled: myTextEdit.selectedText !== "" enabled: myTextEdit.selectedText !== ""
onTriggered: myTextEdit.copy() onTriggered: myTextEdit.copy()
/* shortcut: StandardKey.Copy Shortcuts in QQC2 seem to override global shortcuts */ /* shortcut: StandardKey.Copy Shortcuts in QQC2 seem to override global shortcuts */
} }
Controls2.Action { Controls2.MenuItem {
text: "Cut" text: "Cut"
enabled: myTextEdit.selectedText !== "" && !myTextEdit.readOnly enabled: myTextEdit.selectedText !== "" && !myTextEdit.readOnly
onTriggered: myTextEdit.cut() onTriggered: myTextEdit.cut()
/* shortcut: StandardKey.Cut Shortcuts in QQC2 seem to override global shortcuts */ /* shortcut: StandardKey.Cut Shortcuts in QQC2 seem to override global shortcuts */
} }
Controls2.Action { Controls2.MenuItem {
text: "Paste" text: "Paste"
enabled: myTextEdit.canPaste enabled: myTextEdit.canPaste
onTriggered: myTextEdit.paste() onTriggered: myTextEdit.paste()
/* shortcut: StandardKey.Paste Shortcuts in QQC2 seem to override global shortcuts */ /* shortcut: StandardKey.Paste Shortcuts in QQC2 seem to override global shortcuts */
} }
Controls2.Action { Controls2.MenuItem {
text: "Delete" text: "Delete"
enabled: myTextEdit.selectedText !== "" enabled: myTextEdit.selectedText !== ""
onTriggered: myTextEdit.remove(myTextEdit.selectionStart, onTriggered: myTextEdit.remove(myTextEdit.selectionStart,
myTextEdit.selectionEnd) myTextEdit.selectionEnd)
/* shortcut: StandardKey.Delete Shortcuts in QQC2 seem to override global shortcuts */ /* shortcut: StandardKey.Delete Shortcuts in QQC2 seem to override global shortcuts */
} }
Controls2.Action { Controls2.MenuItem {
text: "Clear" text: "Clear"
enabled: myTextEdit.text !== "" enabled: myTextEdit.text !== ""
onTriggered: myTextEdit.clear() onTriggered: myTextEdit.clear()