Results 1 to 4 of 4

Thread: QFileDialog Mac / PC

  1. #1
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    1

    Default QFileDialog Mac / PC

    Hi everyone,

    I use QFileDialog in my application, and I have 2 questions about that.

    - I would like to set the default directory that will be opened when call to QFileDialog, on Mac.
    How can I do that ? on PC I set the third parameter of "getOpenFileNames", but on Mac, the doc said that third parameter (ie dir) is ignored, and QFileDialog open in the last used directory.

    - Is it possible, on PC this time, to have an Image Preview and Image Info on current selected File, in the QFileDialog ? (like it is on Mac)

    Thank you.

    Alex.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QFileDialog Mac / PC

    What happens if instead of using the static member functions, you create a QFileDialog instance, do setDirectory() and then open the dialog?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    1

    Default Re: QFileDialog Mac / PC

    I tryed, but in this case I loose the "System's Look 'n Feel" of the file dialog.

    I would like to use a "MacOs like" fileDialog and set the defaut directory ...

    Thanks

  4. #4
    Join Date
    Mar 2006
    Location
    Mountain View, California
    Posts
    489
    Thanks
    3
    Thanked 74 Times in 54 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QFileDialog Mac / PC

    You can't set the starting directory on the Mac, because QFileDialog is using the native Mac dialog, which doesn't have this. Instead it uses the last directory seen. This is standard Mac behavior, and Mac users will expect it, so I wouldn't worry about it.

    The image preview and info also comes from the native Mac dialog. Qt isn't doing this, OSX is doing it. To get this behavior on other platforms, you'll need to write your own file dialog, preview and info routines, etc.

  5. The following user says thank you to Brandybuck for this useful post:

    hey (27th April 2007)

Similar Threads

  1. QFileDialog hidden files
    By blukske in forum Qt Programming
    Replies: 3
    Last Post: 8th March 2007, 03:11
  2. Problem in the QFileDialog
    By joseph in forum Qt Programming
    Replies: 11
    Last Post: 7th December 2006, 10:56
  3. Auto resolve in QFileDialog
    By Levon Nikoghosyan in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2006, 12:15
  4. ActiveWindow changes after closing QFileDialog
    By mischi in forum Qt Programming
    Replies: 3
    Last Post: 13th July 2006, 13:45
  5. copy file/s from QFileDialog
    By raphaelf in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 15: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.