PDA

View Full Version : Setting Dynamic Values to Tumbler Has no effect visually



beemaneni
26th April 2016, 08:13
Hi
I am using Enterprise Version of Qt.I have this tumbler in controls which works as expected in normal cases i.e., if we pass any static model to it it works. But When Component is loaded i want to change current index value of Tumbler to some Value. Here my code is as :


Tumbler {
id: _yearTumbler
height: 200
TumblerColumn {
id: _yearColumn
model:_yearModel //model contain values from 2000 to 2100
}
}
Component.onCompleted:{
_yearTumbler.setCurrentIndexAt(0,16); // i need to set 2016 as curent Value.
}

I feel value is set in model but not physically.(Tumbler does not move on settibng values)
Pls suggest some inputs

Regards
Bala B

anda_skoa
26th April 2016, 14:46
I haven't used this Tumbler element before, but my guess is that it is empty when first created, so setting a current index has no effect.

You could try in onModelChanged in the column or with delayed initialization (e.g. via a Timer)

Cheers,
_