Results 1 to 2 of 2

Thread: Restrict user from entering space in Save As File Name

  1. #1
    Join Date
    Apr 2006
    Posts
    28
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Restrict user from entering space in Save As File Name

    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

  2. #2
    Join Date
    May 2006
    Location
    Bangalore,India
    Posts
    235
    Thanks
    7
    Thanked 25 Times in 24 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Restrict user from entering space in Save As File Name

    Hi Malhotra,

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

Similar Threads

  1. Restrict user to open the same file
    By vermarajeev in forum General Programming
    Replies: 33
    Last Post: 25th May 2007, 08:15
  2. linking user space and kernel space programs with qmake
    By zielchri in forum Qt Programming
    Replies: 9
    Last Post: 8th March 2006, 23:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.