67129ef9cd
Instead of returning just bool, return a result struct {State, CharBuff}, a State is useful as it can have an Intermediate state where the input isn't Acceptable yet, but not Invalid as such. The example from the linked bug is in tst_QIntValidator::validateFrench(), a string "1 ", which can be interpretted as a number with a group separator, but the input shouldn't end with a group separator (changing the unittest will be done as part of a separate commit). CharBuff (QVarLengthArray<char, 256>) replaces the QByteArray input parameter; a QVarLengthArray means no heap allocation in typical use-cases with input text < 256 characters to validate. This required minimum changes (QVLA doesn't have startsWith, replaced by comparing with buff[0]; and for converting to double, wrapped it in a QBAV). Task-number: QTBUG-111371 Change-Id: I4e0eb612d470ef03faf52031ddfe9c4bdb31e1e1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake | ||
sync.profile |