Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

shortcut in menuitem is removed in QtQuick2, equivalent way?



  • hi, experts:
    in qtquick1, following code can act exactly what I want:
    MenuItem {
    shortcut: "Ctrl+O"
    text: qsTr("Open Project")
    }

    0_1547975522737_0ee436f0-f787-45d6-a165-a7ead38b7b72-image.png

    but in qtquick2, no shortcut property provided. if using action:
    MenuItem {
    action: copyAction
    }
    Action {
    id: copyAction
    text: qsTr("Copy")
    shortcut: "Ctrl+C"
    }

    0_1547975695311_6f65a471-080e-44d2-8ed2-c8240b5556ab-image.png
    Although the function works but no "Ctrl + C" showed.
    Anyone knows the equivalent way? I don't want the answer like:
    "set text to "Copy (spaces.....) Ctrl + C"", it's too stupid.


Log in to reply