[Qt-interest] QFileDialog signals

Zeljko zeljko at holobit.net
Sat Sep 4 10:56:09 CEST 2010


Oliver.Knoll at comit.ch wrote:

> Or are you saying that you indeed manage to get a native Windows file
> dialog when calling a c'tor, as e.g. in:
>     
>     QFileDialog fd;
>     QString initialDirectory = "c:/temp/";
>     fd.setDirectory(initialDirectory);
>     if (fd.exec()) {
>         QString filePath = fd.selectedFiles().at(0);
>         ...
>     }
> 
> ?
> 
> As I said, that gives me the Qt file dialog on Windows XP...

Yes that's correct behaviour.That's not implemented yet for MS WinXY (can
use static functions only). 
On X11 Qt guesses if running under KDE 4.4(5) or Gnome and then shows
apropriate file dialog (gtk2 dialog if gtk theme)), under MacOSX it shows
native mac dialog (because option QFileDialog::DontUseNativeDialog isn't
set for c'tor by default) , but if you set QFileDialog::DontUseNativeDialog
in case of X11 and Mac, you'll get pure Qt dialog too (of course using
c'tor).

zeljko



More information about the Qt-interest-old mailing list