summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorTimur Pocheptsov <Timur.Pocheptsov@digia.com>2015-04-24 16:48:14 +0200
committerTimur Pocheptsov <Timur.Pocheptsov@digia.com>2015-05-13 11:18:21 +0000
commit21e6c7ae4745a76b676dfaa9fe17a2dd40fc0c5c (patch)
treed2c4014d82e26417a10f5dc9535d56d5145c012b /src/widgets
parent2ca1253b13e77643b3d2dd993a038ae2df882311 (diff)
Cocoa integration - implement Qt::WindowModal file dialogs
Previously, for Qt::WindowModal dialogs we were creating modal sheet with beginSheetModalForWindow: and later (from exec) calling -runModal, essentially making a window modal dialog into (now) application modal sheet, which is not right- it's centered relative to desktop and the jump from window modal sheet's position (centered relative to a window) to application modal was quite visible. Now, instead of [panel runModal] (== [NSApp runModalForWindow:panel]) we call [NSApp runModalForWindow:theRequiredWindow]. Change-Id: I793dc72c7d1fe96497bb35754f4d0eac9a5e00e5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dialogs/qdialog.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 65def6d4b8..6676a3ccba 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -534,7 +534,10 @@ int QDialog::exec()
QPointer<QDialog> guard = this;
if (d->nativeDialogInUse) {
- d->platformHelper()->exec();
+ if (windowModality() == Qt::WindowModal)
+ d->platformHelper()->execModalForWindow(d->parentWindow());
+ else
+ d->platformHelper()->exec();
} else {
QEventLoop eventLoop;
d->eventLoop = &eventLoop;