[Qt-interest] QFileDialog on Windows
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Wed Jun 30 17:10:16 CEST 2010
Duane Hebert wrote on Wednesday, June 30, 2010 4:47 PM:
> Using Qt 4.5.1 commercial.
> According to the docs, QFileDialog uses the native file dialog on
> Windows unless you subclass it with a class using the QObject Macro.
http://doc.trolltech.com/4.6/qfiledialog.html#Option-enum - QFileDialog::DontUseNativeDialog
I think the documentation is indeed a bit misleading here, it suggests that you could create a *native* dialog by instantiating a QFileDialog. But to my knowledge you really only get the native instance when using the static methods! At least that was the case when I last checked...
And to my understanding you can pass the option QFileDialog::DontUseNativeDialog to the static method and get a Qt (non-native) instance. In other words, this option only makes sense for the static methods which otherwise use the native instance by default. So the whole part of "By default, the native file dialog is used unless you use a subclass of QFileDialog that contains the Q_OBJECT macro." is totally confusing, since the static methods decide by themselves what kind of instance they want to create (the caller has no influence on that, other than passing the DontUseNativeDialog option), and IMHO you *never* can use the native instance of a dialog, even when directly working with instances of QFileDialog (as you just have experienced). But I might oversee here something, too...
Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list