Results 1 to 10 of 10

Thread: get Tumbler value - howto

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    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: [SOLVED]Re: get Tumbler value - howto

    Each of those TumblerColumn (whatever that element is) has a "weight" associated, right?
    So its "value" is that weight multiplied with the value it shows.

    The "code" you have is then simply the sum of these values.

    Since you did not show the TumblerColumn element, we'll have to make due with part of the ugly code and use currentIndex.

    Qt Code:
    1. TumblerColumn
    2. {
    3. id: ueNumericTumblerColumnDigit1000
    4.  
    5. readonly property int value: currentIndex * 1000
    6.  
    7. model: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    8. } // ueNumericTumblerColumnDigit1000
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. Tumbler {
    2. id: ueLoginKeypadTumbler
    3.  
    4. readonly property int code: ueNumericTumblerColumnDigit1000.value + ....
    5. }
    6.  
    7. Button {
    8. onClicked: print(ueLoginKeypadTumbler.code)
    9. }
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

  2. The following user says thank you to anda_skoa for this useful post:

    MarkoSan (2nd September 2015)

Similar Threads

  1. Replies: 1
    Last Post: 30th July 2010, 07:23
  2. Howto: Qt and RSA crypto
    By jonks in forum Qt Programming
    Replies: 15
    Last Post: 21st April 2010, 15:15
  3. Howto use Qt with Boost ?
    By bilgenratte in forum Qt Programming
    Replies: 3
    Last Post: 1st October 2009, 14:12
  4. HowTo Debug
    By SenSej in forum Newbie
    Replies: 0
    Last Post: 17th October 2008, 12:45
  5. QTreeWidgetItemIterator howto
    By seneca in forum Qt Programming
    Replies: 4
    Last Post: 17th January 2006, 08:26

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.