I'm trying to create different context menus in QML, but I don't know what is the correct syntax for that. I would like to do something like:
contextActions: [
ActionSet {
title: "Action Set"
subtitle: "This is an action set."
actions: if (_corporate.currentView == 2) {
[ ActionItem { title: "Action 1" },
ActionItem { title: "Action 2" },
ActionItem { title: "Action 3" } ]
} else {
[ActionItem { title: "Action 4" },
ActionItem { title: "Action 5" },
ActionItem { title: "Action 6" }
]
}
} // end of ActionSet
] // end of contextActions list
That's obviously wrong syntax, so what is the correct way? Thanks in advance!