PDA

View Full Version : QDoubleVlaidator range



johnmauer
20th October 2010, 15:21
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.

FelixB
20th October 2010, 16:08
std::numeric_limits<double>::epsilon()

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