diff options
author | Nico Vertriest <nico.vertriest@qt.io> | 2017-01-12 12:45:58 +0100 |
---|---|---|
committer | Nico Vertriest <nico.vertriest@qt.io> | 2017-06-13 10:50:35 +0000 |
commit | 5f2ec1a8c73fc7b6c20595110c0e04af21469082 (patch) | |
tree | b253ace70f5b94717278292e0347917bbaf09ce4 /src/quick/util | |
parent | db6f1440cbe78018e442c1fb961310a4e619e8fe (diff) |
Doc: add doc and examples to RegExpValidator QML type
Change-Id: I0ebc06aec6d2392f613fb4c312c189cc1d90a184
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qquickvalidator.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/quick/util/qquickvalidator.cpp b/src/quick/util/qquickvalidator.cpp index a05117bd06..93f414fe80 100644 --- a/src/quick/util/qquickvalidator.cpp +++ b/src/quick/util/qquickvalidator.cpp @@ -219,6 +219,19 @@ 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: + /\d{1,3}(?:,\d{1,3})+$/ + \li An amount consisting of up to 3 numbers before the decimal point, and + 1 to 2 after the decimal point: \li /(\d{1,3})([.,]\d{1,2})?$/ + \endlist */ #endif // validator |