summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs/qfiledialog_mac.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-10-18 13:30:12 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-12-13 12:50:10 (GMT)
commit19148694b1e094ad968e26e6fab448d3d2c7f4d4 (patch)
tree6f6b2be5afe1e2254752712adb301a098d09d84b /src/gui/dialogs/qfiledialog_mac.mm
parenta04b19d34c23df5bb6e4f499b6b12c7a1211969a (diff)
downloadQt-19148694b1e094ad968e26e6fab448d3d2c7f4d4.zip
Qt-19148694b1e094ad968e26e6fab448d3d2c7f4d4.tar.gz
Qt-19148694b1e094ad968e26e6fab448d3d2c7f4d4.tar.bz2
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.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/dialogs/qfiledialog_mac.mm b/src/gui/dialogs/qfiledialog_mac.mm
index 87850a7..1e13113 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