Results 1 to 3 of 3

Thread: QFileDialog disable Dir Path

  1. #1
    Join Date
    Jan 2007
    Posts
    92
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default QFileDialog disable Dir Path

    Guys,

    How to disable drop down option in the comboBox in the QFileDialog so user can view only current directory path. I have tried using static such as getSaveFileName etc. But I am not able to either dsiable directory path combobox or drop down paths. I want to restrict user to view only given path.

    Qt Code:
    1. QString path = qApp->applicationDirPath ();
    2. QFileDialog* fd = new QFileDialog( path );
    3.  
    4. fd->setPreviewMode( QFileDialog::Contents );
    5. fd->exec();
    To copy to clipboard, switch view to plain text mode 
    Any ideas or hints will be helpful.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileDialog disable Dir Path

    You'll need to do some hacking. You have to check Qt's sources to find out what the object name of the combobox is. Then use qFindChildren() (or whatever it is called in Qt3) on the dialog to query for the pointer to the object with a given name. Then you'll be able to hide or disable the widget.

  3. The following user says thank you to wysota for this useful post:

    user_mail07 (15th April 2008)

  4. #3
    Join Date
    Jan 2007
    Posts
    92
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default Re: QFileDialog disable Dir Path

    Thanks Wyosta ..That's exactly I did and solved my problem. I used QObject::queryList to find the objectName and type.

Similar Threads

  1. how do I get the default picture path of qtopia 2.2
    By pencilren in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th September 2007, 09:01
  2. QFileDialog in Qt designer
    By tpf80 in forum Qt Tools
    Replies: 1
    Last Post: 17th May 2007, 00:41
  3. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  4. Which path should I use?
    By Dark_Tower in forum Newbie
    Replies: 3
    Last Post: 8th April 2006, 12:09

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.