summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qvalidator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/util/qvalidator.cpp')
-rw-r--r--src/gui/util/qvalidator.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/util/qvalidator.cpp b/src/gui/util/qvalidator.cpp
index 61eed3fff1..ede4ccd482 100644
--- a/src/gui/util/qvalidator.cpp
+++ b/src/gui/util/qvalidator.cpp
@@ -363,8 +363,9 @@ QIntValidator::~QIntValidator()
\fn QValidator::State QIntValidator::validate(QString &input, int &pos) const
Returns \l Acceptable if the \a input is an integer within the
- valid range, \l Intermediate if the \a input is a prefix of an integer in the
- valid range, and \l Invalid otherwise.
+ valid range. If \a input has at most as many digits as the top of the range,
+ or is a prefix of an integer in the valid range, returns \l Intermediate.
+ Otherwise, returns \l Invalid.
If the valid range consists of just positive integers (e.g., 32 to 100)
and \a input is a negative integer, then Invalid is returned. (On the other
@@ -373,6 +374,10 @@ QIntValidator::~QIntValidator()
the user might be just about to type the minus (especially for right-to-left
languages).
+ Similarly, if the valid range is between 46 and 53, then 41 and 59 will be
+ evaluated as \l Intermediate, as otherwise the user wouldn't be able to
+ change a value from 49 to 51.
+
\snippet code/src_gui_util_qvalidator.cpp 2
By default, the \a pos parameter is not used by this validator.