summaryrefslogtreecommitdiffstats
path: root/src/gui
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/gui
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/gui')
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp6
-rw-r--r--src/gui/kernel/qplatformdialoghelper.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 3d37088182..3d7c2f7bf0 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -137,6 +137,12 @@ QVariant QPlatformDialogHelper::defaultStyleHint(QPlatformDialogHelper::StyleHi
return QVariant();
}
+void QPlatformDialogHelper::execModalForWindow(QWindow *parent)
+{
+ Q_UNUSED(parent);
+ exec();
+}
+
// Font dialog
class QFontDialogOptionsPrivate : public QSharedData
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h
index 8b2b9881b7..6d3a367e60 100644
--- a/src/gui/kernel/qplatformdialoghelper.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -145,6 +145,7 @@ public:
virtual QVariant styleHint(StyleHint hint) const;
virtual void exec() = 0;
+ virtual void execModalForWindow(QWindow *parent);
virtual bool show(Qt::WindowFlags windowFlags,
Qt::WindowModality windowModality,
QWindow *parent) = 0;