[Qt-interest] QFileDialog: native + sheet (Window modal) not possible?
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Thu Jan 27 17:32:32 CET 2011
Hi,
can anyone confirm my assumption here, that with the current Qt 4.7.1 it is apparently not possible to have both
* native dialogs and
* Window modal dialogs (aka Sheets on Mac) (http://labs.qt.nokia.com/2010/02/23/unpredictable-exec/)
Apparently (http://stackoverflow.com/questions/2609119/qt-qfiledialog-native-dialogs-only-with-static-functions) the only way to get native file dialogs - at least on Windows - seems to be to use the static flavours (getOpenFileName() etc.), even though the documentation of QFileDialog::DontUseNativeDialog ("By default, the native file dialog is used unless you use a subclass of QFileDialog that contains the Q_OBJECT macro.") suggests otherwise.
But as also figured out in some past discussion (http://comments.gmane.org/gmane.comp.lib.qt.general/32975) instantiating a new QFileDialog *always* creates the "Qt File Dialog", not the native one.
Assuming that this is also the behaviour on Mac (I haven't tried it yet) this would mean that it is not possible to use a QFileDialog as sheet ("window modal"), because "The static functions will always be an application modal dialog. If you want to use sheets, use QFileDialog::open() instead." (http://doc.qt.nokia.com/4.7/qfiledialog.html#Option-enum).
But using open() requires me to instantiate a QFileDialog instance, which gives me the "Qt file dialog" again.
So is the statement correct: "With Qt 4.7.1, *native* "window modal" aka "sheet" file dialogs are not possible." - or am I missing something here?
Thanks,
Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list