PDA

View Full Version : Restrict user from entering space in Save As File Name



jyoti kumar
5th September 2007, 11:16
Hi,
I just want to know how to restrict user to enter space in the file name while accepting file name from the user in Save As option.
I am using QFileDialog::getSaveFileName() but with this on linux, user can enter spaces.

Thanks & Regards
Jyoti

rajesh
5th September 2007, 12:47
Hi Malhotra,

you can create own FileDialogBox with following Validator code:
QRegExp regExpforName("\\w (file://\\w)+");
QLineEdit * m_pTextInput ->setValidator(new QRegExpValidator(regExpforName, m_pTextInput));