Menu { id: menu Repeater { id: modelMenu delegate: DelegateChooser { role: "role" DelegateChoice { roleValue: "text" delegate: MenuItem { text: model.text onTriggered: root.menuItemClicked(model.index, selectModel) } } DelegateChoice { roleValue: "separator" delegate: MenuSeparator {} } DelegateChoice { roleValue: "submenu" delegate: Menu { title: model.text Repeater { model: subMenu MenuItem { text: modelData } } } } } } }