Results 1 to 4 of 4

Thread: QRegExpValidator

  1. #1
    Join Date
    Jul 2014
    Posts
    12
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QRegExpValidator

    hi
    i have a line edit which should accepts the values between 0.0 to 405.00
    I tired it using QDoubleValidator which didnt work. i thought of using QRegExpValidator... i read the document regarding and
    i found it was so confusing
    can any one help me with the expression dat is used to set the required limit

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QRegExpValidator

    What it means QDoubleValidator didnt work ?

  3. #3
    Join Date
    Jul 2014
    Posts
    12
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QRegExpValidator

    QDoubleValidator accepts the value out of range, it even accepts 999.
    Qt Code:
    1. QDoubleValidator *val9 = new QDoubleValidator(0,405,1,this);
    2.  
    3. ui->lineEdit->setValidator(val9);
    4. ui->lineEdit_2->setValidator(val9);
    To copy to clipboard, switch view to plain text mode 
    Last edited by vinaysagar; 13th August 2014 at 08:49.

  4. #4
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QRegExpValidator

    How about QDoubleSpinBox instead QLineEdit ?

Similar Threads

  1. QRegExpValidator not validating.
    By m3rlin in forum Qt Programming
    Replies: 8
    Last Post: 18th March 2013, 07:37
  2. editing string in QLineEdit with QRegExpValidator
    By Al_ in forum Qt Programming
    Replies: 0
    Last Post: 28th April 2012, 10:51
  3. Memory leak in QRegExpValidator?!?
    By Tiansen in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2009, 14:17
  4. Mixing QRegExpValidator and input mask and QLineEdit
    By abernat in forum Qt Programming
    Replies: 1
    Last Post: 18th February 2009, 00:04
  5. QRegExpValidator
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 28th February 2007, 14:07

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.