Unsolved hwo to change item name in delegate: itemDelegate?
-
I see this code in sidepanel project example
model: 10 delegate: ItemDelegate { text: qsTr("Title %1").arg(index + 1) width: parent.width } ScrollIndicator.vertical: ScrollIndicator { } }
it create item with name Title 1, Title 2, Title 3, ..., Title 10
How to change the item name to another different name like Dasboard, Library, Costumer, and so on?
-
-
Hi,
you can create a property variant like this : property variant myDifferentNames : ["Dasboard", "Library", "Costumer" ]and then
...
delegate: ItemDelegate {
text: myDifferentNames[index] // qsTr("Title %1").arg(index + 1)
width: parent.width
}
...LA