> -----Original Message----- > From: Interest <interest-boun...@qt-project.org> On Behalf Of Alexander > Dyagilev > Sent: Tuesday, 10 September 2019 3:11 PM > To: interestqt-project.org <interest@qt-project.org> > Subject: [Interest] QML and mac system menu > > Hello, > > I have the following code: > > import QtQuick 2.12 > import QtQuick.Controls 2.12 > import QtQuick.Window 2.0 > import Qt.labs.platform 1.0 as QtLabs > > ApplicationWindow { > width: 1024 > height: 600 > visible: true > > TextArea > { > anchors.fill: parent > selectByMouse: true > } > > QtLabs.MenuBar { > > QtLabs.Menu { > title: qsTr("&File") > > QtLabs.MenuItem { > text: qsTr("&Open") > onTriggered: openDialog.open() > } > > QtLabs.MenuItem { > text: qsTr("&Quit") > onTriggered: Qt.quit() > } > } > > QtLabs.Menu { > title: qsTr("&Edit") > type: QtLabs.Menu.EditMenu > > QtLabs.MenuItem { > text: qsTr("&Copy") > shortcut: StandardKey.Copy > > } > QtLabs.MenuItem { > text: qsTr("Cu&t") > shortcut: StandardKey.Cut > > } > QtLabs.MenuItem { > text: qsTr("&Paste") > shortcut: StandardKey.Paste > } > } > } > } > > > 1) In my TextArea Cmd+V (Paste) keyboard shortcut works, but Paste menu > item from mac system menu is not working. Am I doing something wrong or I > should implement it on my own? This can be quite annoying because in my > real app I have many text controls in different situations.
You have to do the logic yourself. https://doc.qt.io/qt-5/qtquickcontrols-texteditor-example.html > 2) Is there a way to add my custom menu items to the first menu element of > my app system menu (which is bold). E.g. "untitled" in my case: . "Quit" > menu goes there automatically despite it's in "File" menu really, according to > the QML code. > In my experience the Quit menu item goes where it wants to. It seems to be a feature of macOS. _______________________________________________ Interest mailing list Interest@qt-project.org https://lists.qt-project.org/listinfo/interest