diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-10-18 15:30:12 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-12-13 13:50:10 +0100 |
commit | 19148694b1e094ad968e26e6fab448d3d2c7f4d4 (patch) | |
tree | 6f6b2be5afe1e2254752712adb301a098d09d84b /src/gui/dialogs/qfiledialog_mac.mm | |
parent | a04b19d34c23df5bb6e4f499b6b12c7a1211969a (diff) | |
download | qt4-tools-19148694b1e094ad968e26e6fab448d3d2c7f4d4.tar.gz |
Cocoa: cannot use staysOnTop flag for native file dialogs
We cannot mix staysOnTop and native file dialogs, since Cocoa will
anyway set it back to NSModalPanelWindowLevel when running it
app modal. There are ways to work around this issue, but the file
dialog also has a button for showing a "create directory" modal
panel, and this we cannot control.
Reviewed-by: cduclos
Diffstat (limited to 'src/gui/dialogs/qfiledialog_mac.mm')
-rw-r--r-- | src/gui/dialogs/qfiledialog_mac.mm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm index 87850a75e4..1e13113834 100644 --- a/src/gui/dialogs/qfiledialog_mac.mm +++ b/src/gui/dialogs/qfiledialog_mac.mm @@ -719,6 +719,14 @@ bool QFileDialogPrivate::setVisible_sys(bool visible) if (!visible == q->isHidden()) return false; + if (q->windowFlags() & Qt::WindowStaysOnTopHint) { + // The native file dialog tries all it can to stay + // on the NSModalPanel level. And it might also show + // its own "create directory" dialog that we cannot control. + // So we need to use the non-native version in this case... + return false; + } + #ifndef QT_MAC_USE_COCOA return visible ? showCarbonNavServicesDialog() : hideCarbonNavServicesDialog(); #else |