Results 1 to 2 of 2

Thread: Setting Dynamic Values to Tumbler Has no effect visually

  1. #1
    Join Date
    Jul 2013
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Setting Dynamic Values to Tumbler Has no effect visually

    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 :

    Qt Code:
    1. Tumbler {
    2. id: _yearTumbler
    3. height: 200
    4. TumblerColumn {
    5. id: _yearColumn
    6. model:_yearModel //model contain values from 2000 to 2100
    7. }
    8. }
    9. Component.onCompleted:{
    10. _yearTumbler.setCurrentIndexAt(0,16); // i need to set 2016 as curent Value.
    11. }
    To copy to clipboard, switch view to plain text mode 

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

    Regards
    Bala B

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Setting Dynamic Values to Tumbler Has no effect visually

    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,
    _

Similar Threads

  1. get Tumbler value - howto
    By MarkoSan in forum Qt Quick
    Replies: 9
    Last Post: 2nd September 2015, 09:39
  2. Replies: 5
    Last Post: 16th September 2014, 23:37
  3. Replies: 3
    Last Post: 30th April 2012, 08:39
  4. Replies: 3
    Last Post: 25th September 2011, 15:44
  5. Replies: 5
    Last Post: 5th September 2009, 07:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.