Fix QRegExpValidator::validate docs about the pos parameter
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Sun, 14 Oct 2012 03:12:35 +0000 (04:12 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 22 Oct 2012 20:42:26 +0000 (22:42 +0200)
commitbbda968a0a3230b1ddb55b27e4dcc627fc087bbd
tree66b30d489ca776c1d8f0fcd1f9c866c5d9fd07ea
parent6fe8a3d5a1c1f2b963fe25e9032b562f6c6467e6
Fix QRegExpValidator::validate docs about the pos parameter

The code sets it to input.length() iff the regexp doesn't
match the string, while the docs say it's *always* set.

Therefore, make the docs match what the code does and
add a simple test to enforce it.

We're not changing the code to match the docs because

1) it's better to stay conservative (we don't want
to break existing behaviour);

2) this behaviour mimics what the int/double validators do
(they don't move pos at all).

Change-Id: I958074558de6b0fc5944101c6535fc7e00442ae9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
src/gui/util/qvalidator.cpp
tests/auto/gui/util/qregexpvalidator/tst_qregexpvalidator.cpp