Results 1 to 2 of 2

Thread: QDoubleVlaidator range

  1. #1
    Join Date
    Dec 2009
    Posts
    47
    Thanks
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default QDoubleVlaidator range

    QDoubleValidator accepts a bottom and top in order to set the range of allowed numbers, that is, it is inclusive of the end points [a,b]. Is there an efficient way to set the range exclusive of the end points (a,b)? For instance, I would like to set the range to (0., 1.) so that both 0. and 1. are excluded (but any number in between is accepted). Thus, "0." would be Intermediate, but "1." would be Invalid.

  2. #2
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QDoubleVlaidator range

    Qt Code:
    1. std::numeric_limits<double>::epsilon()
    To copy to clipboard, switch view to plain text mode 

    use epsilon as minValue and (1-epsilon) as max value...

  3. The following user says thank you to FelixB for this useful post:

    johnmauer (20th October 2010)

Similar Threads

  1. Out of range detection
    By zgulser in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2009, 10:32
  2. Index out of Range
    By santhoshv84 in forum Qt Programming
    Replies: 2
    Last Post: 19th August 2008, 16:33
  3. QLineEdit set min max range?
    By whitefurrows in forum Qt Programming
    Replies: 29
    Last Post: 11th June 2006, 00:51
  4. Elements out of Range!!
    By Kapil in forum Newbie
    Replies: 9
    Last Post: 3rd April 2006, 11:28
  5. Drag vs range-select
    By drhex in forum Qt Programming
    Replies: 0
    Last Post: 19th February 2006, 21:39

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.