Qt World Summit: Register Today!

Make a tree in Qml with Menu

  • Hello everybody,

    I try to make a dynamic tree at 3 level with the component Menu ( I did not find better), but It does not work
    this is my code :

    Button {
            id: fileButton
            text: "File"
            onClicked: menu.open()
            //Component.onCompleted: menu.open()
                model : ["1", "2", "3"]
                delegate : Button{
                    id : menu
                    text : modelData
                    onClicked: menu2.open()
                        y: fileButton.height
                        id : menu2
                            model : ["a", "b", "c"]
                            delegate : Button{
                                y: menu.height
                                id : menu3
                                text : modelData
            }//end listView

    I am working on Qt 5.9
    do you have an idea to resolve my problem ?

  • @cosmoff hi
    its hard to understand what you are trying to achive, can you show an mockup of what you need ?

    note there is a TreeView QML type

  • Yes, I Would like something like that :

Log in to reply