Results 1 to 6 of 6

Thread: QDoubleValidator, top and button range does not work..

  1. #1
    Join Date
    May 2008
    Location
    Spain
    Posts
    92
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QDoubleValidator, top and button range does not work..

    Hello,

    I have a form with QLineEdit that it has a QDoubleValidator:

    Qt Code:
    1. ui.lineEdit->setValidator(new QDoubleValidator(-999.99, 999.99, 2, ui.lineEdit));
    To copy to clipboard, switch view to plain text mode 

    Instead, QLineEdit accept values up to 1000, for example 55598989.

    is there any bug in QDoubleValidator in Qt 4.5 or perhpas I do not make it correctly???

    Best regards

  2. #2
    Join Date
    Oct 2008
    Posts
    74
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDoubleValidator, top and button range does not work..

    Hi

    I am having the same problem Qt4.5.0, the number of decimal digits is Ok bu range does not work?

  3. #3
    Join Date
    Mar 2009
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QDoubleValidator, top and button range does not work..

    Same thing for me in Qt 4.4.3-X11. Decimals works, but not bottom and top.

  4. #4
    Join Date
    Mar 2009
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QDoubleValidator, top and button range does not work..

    A little forum searching gave me this:

    http://www.qtcentre.org/forum/p-what...ostcount2.html

  5. #5
    Join Date
    May 2008
    Location
    Spain
    Posts
    92
    Thanks
    13
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QDoubleValidator, top and button range does not work..

    Well,

    Now I use this code:

    Qt Code:
    1. QDoubleValidator *myDblVal = new QDoubleValidator(-999.99, 999.99, 2, this);
    2. myDblVal->setNotation(QDoubleValidator::StandardNotation);
    3. ui.lineEdit->setValidator(myDblVal);
    To copy to clipboard, switch view to plain text mode 

    If I change to Standard Notacion, QValidator works fine, but there is a bit problem.
    As you can see in my example, my ranges are -999.00 - 999.99. Well, next step is to change this range, for example 0.00 - 1999.99.

    After compile and execute new program, I advice that I can write values up to 1999.99 , for example 3999.89, BUT, I can not write values up to 9999.99. It seems that top range does not work fine, but avoid to write values up to 4 digits without decimals.

  6. #6
    Join Date
    Aug 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: QDoubleValidator, top and button range does not work..

    I know it's a late reply, but I think this is the reason why you think your QDoubleValidator is not working :

    http://qt.nokia.com/developer/faqs/f...-15.0450651751

Similar Threads

  1. setchecked( true) of the radio button doesn't work
    By richardander in forum Qt Programming
    Replies: 9
    Last Post: 28th January 2009, 18:54
  2. why doesn't the button work?
    By mattia in forum Newbie
    Replies: 18
    Last Post: 5th November 2007, 13:14
  3. Replies: 2
    Last Post: 1st August 2006, 11:23

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.