Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML Menu has no text
Qt 6.11 is out! See what's new in the release blog

QML Menu has no text

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 610 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NCsoft
    wrote on last edited by
    #1

    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: {
                }
            }
        }
    }
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved