diff options
Diffstat (limited to 'src/quick/util/qquickvalidator.cpp')
-rw-r--r-- | src/quick/util/qquickvalidator.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/quick/util/qquickvalidator.cpp b/src/quick/util/qquickvalidator.cpp index a05117bd06..c3ce149dcf 100644 --- a/src/quick/util/qquickvalidator.cpp +++ b/src/quick/util/qquickvalidator.cpp @@ -219,6 +219,25 @@ void QQuickDoubleValidator::resetLocaleName() matching "a". By default, this property contains a regular expression with the pattern .* that matches any string. + + Below you can find an example of a \l TextInput object with a RegExpValidator specified: + + \snippet qml/regexp.qml 0 + + Some more examples of regular expressions: + + \list + \li A list of numbers with one to three positions separated by a comma: + \badcode + /\d{1,3}(?:,\d{1,3})+$/ + \endcode + + \li An amount consisting of up to 3 numbers before the decimal point, and + 1 to 2 after the decimal point: + \badcode + /(\d{1,3})([.,]\d{1,2})?$/ + \endcode + \endlist */ #endif // validator |