79QValidator *validator =
new QRegularExpressionValidator(
rx,
this);
89QRegularExpressionValidator
v(re, 0);
93s =
"0";
v.validate(
s,
pos);
94s =
"12345";
v.validate(
s,
pos);
95s =
"1";
v.validate(
s,
pos);
98v.setRegularExpression(re);
99s =
"myfile.txt";
v.validate(
s,
pos);
100s =
"my file.txt";
v.validate(
s,
pos);
103re.setPattern(
"[A-C]\\d{5}[W-Z]");
104v.setRegularExpression(re);
105s =
"a12345Z";
v.validate(
s,
pos);
106s =
"A12345Z";
v.validate(
s,
pos);
107s =
"B12";
v.validate(
s,
pos);
110re.setPattern(
"read\\S?me(\\.(txt|asc|1st))?");
112v.setRegularExpression(re);
113s =
"readme";
v.validate(
s,
pos);
114s =
"README.1ST";
v.validate(
s,
pos);
115s =
"read me.txt";
v.validate(
s,
pos);
116s =
"readm";
v.validate(
s,
pos);
The QDoubleValidator class provides range checking of floating-point numbers.
The QIntValidator class provides a validator that ensures a string contains a valid integer within a ...
The QLineEdit widget is a one-line text editor.
void setValidator(const QValidator *)
Sets the validator for values of line edit to v.
\inmodule QtCore \reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QValidator class provides validation of input text.
void setLocale(const QLocale &locale)
Sets the locale that will be used for the validator.
GLsizei const GLfloat * v
[13]
GLenum GLenum GLenum input