Tumbler´s Delegate removes TumblerStyle
Solved
General and Desktop
-
Hello,
I have a small problem with Tumbler.
When I am using tumbler with model then is everything fine. It shows me a tumbler with 1 column [0, 1, 2, 3, 4];Tumbler { id: tumbler1 TumblerColumn { model: 5 } }
But when I am trying to add Delegate to add 1 to each value ( [1, 2, 3, 4, 5] ) to TumblerColumn, then TumblerStyle is being lost and everything looks awful.
Tumbler { id: tumbler2 TumblerColumn { model: 5 delegate: Text { text: styleData.value + 1 } } }
is there any specific trick to solve that issue?
Thank you in advance! -
@mike_student
I have managed to fix data in TumblerColumn with JS and ComponentTumblerColumn { id: lastCheckDay Component.onCompleted: { var days = []; for (var i = 1; i <= 31; ++i) { days.push(i); } lastCheckDay.model = days; } }
this way allows me to change values for TumblerColumn without Delegate and that is why I am not loosing QT styles
I will this answer here, maybe it can be helpful for someone