How is it possible to have qlineedit->settext()
to accept file of type .ma only?
views:
33answers:
1
+2
A:
I assume you want the string to be of the format <filename>.ma
in the QLineEdit
.
If that's the case, you can use
void QLineEdit::setValidator ( const QValidator * v )
Also, QRegExpValidator
can validate for specific strings.
I am not well versed with RegExp but I guess QRegExp rx("*.ma");
as an Regular Expression will be fine for your case.
Hope it helps...
liaK
2010-08-11 08:33:43
you might need `rx.setPatternSyntax(QRegExp::Wildcard);`, or you use a real regulare expression instead of a wildcard syntax.
smerlin
2010-08-11 19:42:55
@ smerlin, Yep.. Thanks.. :)
liaK
2010-08-12 07:06:52