PDA

View Full Version : QFileDialog Mac / PC



hey
26th April 2007, 10:21
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.

high_flyer
26th April 2007, 11:26
What happens if instead of using the static member functions, you create a QFileDialog instance, do setDirectory() and then open the dialog?

hey
26th April 2007, 12:46
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

Brandybuck
26th April 2007, 18:23
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.