Results 1 to 3 of 3

Thread: WHAT COMPONENT CAN I USE TO READ double VALUES?

  1. #1
    Join Date
    Jul 2012
    Posts
    201
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default WHAT COMPONENT CAN I USE TO READ double VALUES?

    Hi everyone, I'm having trouble finding the right component to read "double" values from the keyboard. I've tried a QDoubleSpinBox but it only take a number no longer than 2 digits before the decimal point. Can I use a QLineEdit component and than find someway to convert my input into double values? And also my program is suppose to pop-up an error message in case text is entered instead of digits. PLEASE ASSIST.

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: WHAT COMPONENT CAN I USE TO READ double VALUES?

    QDoubleSpinBox has properties to set up a number of digits, max and min value. See QDoubleSpinBox::maximum, QDoubleSpinBox::minimum, QDoubleSpinBox::decimals.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: WHAT COMPONENT CAN I USE TO READ double VALUES?

    Quote Originally Posted by ayanda83 View Post
    WHAT COMPONENT CAN I USE TO READ double VALUES?
    PLEASE ASSIST.
    No need to YELL, we can also read quiet text.

Similar Threads

  1. Replies: 2
    Last Post: 23rd February 2012, 01:11
  2. Replies: 0
    Last Post: 29th March 2010, 03:46
  3. How to read and get the values out of the xml?
    By dark1988 in forum Qt Programming
    Replies: 1
    Last Post: 26th July 2008, 00:29
  4. How to read and get the values out of the xml?
    By dark1988 in forum Qt Programming
    Replies: 6
    Last Post: 15th July 2008, 08:41
  5. Progress Bar with double values
    By ^NyAw^ in forum Qt Programming
    Replies: 8
    Last Post: 23rd March 2007, 15:37

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.