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.
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.
_______________________________________________
Interest mailing list
[email protected]
https://lists.qt-project.org/listinfo/interest