QML Menu has no text



  • hi,
    recently i need a context menu, and i found a example in QT doc:(http://doc.qt.io/qt-5/qml-qtquick-controls-menu.html).
    my problem is :when i click right button, context menu popup with no text on it, its just a white rectangle.
    anyone knows how can i solve this?
    Here's my code:

    Window {
        visible: true
        width: 360
        height: 360
    
        Rectangle {
            anchors.fill: parent
            color: "#555555"
    
            MouseArea {
                anchors.fill: parent
                acceptedButtons: Qt.RightButton
                onClicked: {
                    edit.popup()
                }
            }
        }
    
        Menu {
            id: edit
            MenuItem {
                text: "Cut"
                shortcut: "Ctrl+X"
                onTriggered: {
                }
            }
    
            MenuItem {
                text: "Copy"
                shortcut: "Ctrl+C"
                onTriggered: {
                }
            }
    
            MenuItem {
                text: "Paste"
                shortcut: "Ctrl+V"
                onTriggered: {
                }
            }
        }
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.