Results 1 to 5 of 5

Thread: QFileDialog use

  1. #1
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QFileDialog use

    Is there a way to make a QFileDialog limited to staying in a given directory branch, e.g. it will display files and directories under /some/branch but nowhere else? Also, I would like the /some/branch to not show (everything appears as if in root directory).

    Thanks

  2. #2
    Join Date
    Jan 2007
    Posts
    68
    Thanks
    9
    Thanked 8 Times in 8 Posts

    Default Re: QFileDialog use

    should be possible using:

    Qt Code:
    1. void QFileDialog::setProxyModel ( QAbstractProxyModel * proxyModel )
    To copy to clipboard, switch view to plain text mode 

    subclass the QDirModel implementing the above requirements, then use the proxymodel as the mediator between the dirmodel and the QFileDialog...

    that's what i would try first,

    but maybe there's also simpler solution ???

    greets

  3. #3
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog use

    I'm unable to find documentation on setProxyModel.

    ??

    Thanks

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QFileDialog use

    Quote Originally Posted by Doug Broadwell View Post
    I'm unable to find documentation on setProxyModel.
    Looks like QFileDialog::setProxyModel() was introduced in Qt 4.3
    J-P Nurmi

  5. #5
    Join Date
    Feb 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QFileDialog use

    Hi,

    I have the same problem right now.

    Were you able to solve it?

    If I subclass QDirModel, how can I change the RootDirectory?

Similar Threads

  1. QFileDialog in Qt designer
    By tpf80 in forum Qt Tools
    Replies: 1
    Last Post: 17th May 2007, 00:41
  2. QFileDialog Mac / PC
    By hey in forum Qt Programming
    Replies: 3
    Last Post: 26th April 2007, 18:23
  3. QFileDialog hidden files
    By blukske in forum Qt Programming
    Replies: 3
    Last Post: 8th March 2007, 02:11
  4. Auto resolve in QFileDialog
    By Levon Nikoghosyan in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2006, 11:15
  5. copy file/s from QFileDialog
    By raphaelf in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 14:26

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.