QML RegExpValidator Element

RegExpValidator instantiates the C++ class QRegExpValidator

Properties

Detailed Description

This element provides a validator, which counts as valid any string which matches a specified regular expression.

Property Documentation

regExp : regExp

This property holds the regular expression used for validation.

Note that this property should be a regular expression in JS syntax, e.g /a/ for the regular expression matching "a".

By default, this property contains a regular expression with the pattern .* that matches any string.


Notes provided by the Qt Community
Informative
  • 3

Votes: 1

Coverage: Qt library 4.8

Picture of hmuelner hmuelner

Lab Rat
1 note

Example

  1. TextInput {
  2.    validator: RegExpValidator { regExp: /\d{1,3}/ }
  3. }

[Revisions]