Use column as role in delegateChooser
Unsolved
QML and Qt Quick
-
Working in QML 5, I wish to format my table content (columns) differently based on the column number. For example, col 1 holds a string, col 2 holds a checkmark, col 3 holds and image. etc.
I was hoping to use the column number in my delegatechooser but it fails (never matches a roleValue). Though if I print model.column in the delegate it does show my column number.
How can I use column number in my chooser? (What's wrong with this code)
DelegateChooser { id: chooser role: "model.column" DelegateChoice { roleValue: "0"; ItemDelegate { ... } } DelegateChoice { roleValue: "1"; SwitchDelegate { ... } } DelegateChoice { roleValue: "2"; SwipeDelegate { ... } } }
-
I dunno what your model looks like, but have you tried it this way?
DelegateChooser { DelegateChoice { column: 1; ItemDelegate { ... } } ... }
You can also try
'display'
as a role forDelegateChooser
.