Results 1 to 4 of 4

Thread: How to display floating point values in LCDNumber control ?

  1. #1
    Join Date
    Mar 2006
    Posts
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default How to display floating point values in LCDNumber control ?

    I need to display floating point values from 0.0 to 100 like

    0.0, 0.1,0.2 ....

    I am trying to use display(double) in QLCDNumber class...

    But it will not make any effect .

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to display floating point values in LCDNumber control ?

    What does "has no effect" mean in this case?
    Can't you see no lcd number widget at all? Doesn't the number widget show a correct number? Have you changed the numDigits property?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,363
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to display floating point values in LCDNumber control ?

    QLCDNumber uses ints. You have to set an integer and use setSmallDecimalPoint() to set the decimal point. You can't use doubles directly.

  4. #4
    Join Date
    Mar 2006
    Posts
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to display floating point values in LCDNumber control ?

    Sorry, I don't mean like that ..


    As u said , I try to change the numDigit property.

    I can't chane the value at runtime by using the function display() in QLCDNumber class .

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.