Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mport QtQuick 2.5
- import QtQuick.Controls 2.13 as QQC2
- QQC2.Menu {
- id:root
- Repeater {
- Component {
- id: subMenu
- QQC2.Menu {
- id: menu
- title: menuAction.text
- Repeater{
- model: menuAction.visibleChildren
- delegate: QQC2.MenuItem {
- action: modelData
- }
- }
- Component.onCompleted: {
- root.addMenu(menu)
- }
- }
- }
- Component {
- id: menuItem
- QQC2.MenuItem {
- action: menuAction
- }
- }
- model: actions.actions
- delegate: Loader {
- property var menuAction: modelData
- sourceComponent: modelData.visibleChildren.length > 0 ? subMenu : menuItem
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement