
Originally Posted by
paolom
I need to use this validator ( and not the maxLength ) cause I want to create a unique validator so I can validate a string from the line edit and a string that I read from a file.
Subclass QValidator to check string length instead of using a QRegExpValidator

Originally Posted by
paolom
So, as your opinion, If I want to control an undefined string length ( > 1024 ) is there a suitable regular expression ??!! ( I think surely yes, but I'm not good with reg exp...

)
for (int i
= 1; i < max
/ 1024 - 1;
++i
) s
+= QString(".{0,1024}");
s
+= QString(".{0,%2}").
arg(max
% 1024);
QString s(".{%1, 1024}").arg(min);
for (int i = 1; i < max / 1024 - 1; ++i) s += QString(".{0,1024}");
s += QString(".{0,%2}").arg(max % 1024);
To copy to clipboard, switch view to plain text mode
But, really, that is fugly...
Bookmarks