aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickvalidator.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-06-19 08:20:16 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-06-19 08:20:16 +0200
commit7d28940a316128c8ee43def83a71843711d702c9 (patch)
tree613537bedaeccae8711cb2009614c8f617374adf /src/quick/util/qquickvalidator.cpp
parent4199572d64d46bfa2efdcf7c910e81e5b8fb5547 (diff)
parent1e0685136d0debb2a3b62d9f4650c95afe41913b (diff)
Merge 5.9 into 5.9.1
Diffstat (limited to 'src/quick/util/qquickvalidator.cpp')
-rw-r--r--src/quick/util/qquickvalidator.cpp19
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