Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.10
-
None
Description
The Font and Color actions should be visible, but aren't.
import QtQuick import QtQuick.Controls ApplicationWindow { width: 400 height: 400 visible: true Action { id: fontDialogAction text: qsTr("Fon&t…") shortcut: "Ctrl+T" } Action { id: colorDialogAction text: qsTr("Color…") shortcut: "Ctrl+Shift+C" } Component { id: menuSeparatorComponent MenuSeparator {} } TextArea { id: textArea anchors.fill: parent Component.onCompleted: { textArea.ContextMenu.menu.addItem(menuSeparatorComponent) textArea.ContextMenu.menu.addAction(fontDialogAction) textArea.ContextMenu.menu.addAction(colorDialogAction) } } }
Still happens without using ContextMenu:
import QtQuick import QtQuick.Controls ApplicationWindow { width: 400 height: 400 visible: true Menu { id: menu Action { text: "First action" } } Action { id: fontDialogAction text: qsTr("Font") } Action { id: colorDialogAction text: qsTr("Color") } Component { id: menuSeparatorComponent MenuSeparator {} } Component.onCompleted: { menu.addItem(menuSeparatorComponent) menu.addAction(fontDialogAction) menu.addAction(colorDialogAction) } TapHandler { acceptedButtons: Qt.RightButton onPressedChanged: if (pressed) menu.popup() } }