diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 3d7c2f7bf0dcbd0332493d90d25e00a528f8c5b7..3d37088182c6591490e28c3340847788056374fb 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -137,12 +137,6 @@ 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 6d3a367e60316dbffc45a77f93ca719ae38cd5b7..8b2b9881b7f8ea99d8a7d6c7f59091de1b02b495 100644
--- a/src/gui/kernel/qplatformdialoghelper.h
+++ b/src/gui/kernel/qplatformdialoghelper.h
@@ -145,7 +145,6 @@ 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;
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
index 36943a563e15a97d4878df71b7eab889d79d8748..48d7efe1747d37cd6c23ebacbfc2740168dbee10 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
@@ -51,7 +51,6 @@ public:
     virtual ~QCocoaFileDialogHelper();
 
     void exec();
-    void execModalForWindow(QWindow *parent);
 
     bool defaultNameFilterDisables() const;
 
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 19f81c72a13c1491eedcceb17ea3345d7e48924a..4ece1b5a22ff5319e2c3db9363d18120d38acce4 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -254,22 +254,17 @@ static QString strippedText(QString s)
         || [self panel:nil shouldShowFilename:filepath];
 
     [self updateProperties];
+    QCocoaMenuBar::redirectKnownMenuItemsToFirstResponder();
     [mSavePanel setDirectoryURL: [NSURL fileURLWithPath:mCurrentDir]];
 
     [mSavePanel setNameFieldStringValue:selectable ? QCFString::toNSString(info.fileName()) : @""];
     NSWindow *nsparent = static_cast<NSWindow *>(qGuiApp->platformNativeInterface()->nativeResourceForWindow("nswindow", parent));
 
-    qApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers);
-    QCocoaMenuBar::redirectKnownMenuItemsToFirstResponder();
-
     [mSavePanel beginSheetModalForWindow:nsparent completionHandler:^(NSInteger result){
-        [[NSApplication sharedApplication] stopModalWithCode:result];
+        mReturnCode = result;
+        if (mHelper)
+            mHelper->QNSOpenSavePanelDelegate_panelClosed(result == NSOKButton);
     }];
-
-    mReturnCode = [[NSApplication sharedApplication] runModalForWindow:nsparent];
-    QAbstractEventDispatcher::instance()->interrupt();
-    if (mHelper)
-        mHelper->QNSOpenSavePanelDelegate_panelClosed(mReturnCode == NSOKButton);
 }
 
 - (BOOL)isHiddenFile:(NSString *)filename isDir:(BOOL)isDir
@@ -711,15 +706,14 @@ void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate()
 
 bool QCocoaFileDialogHelper::showCocoaFilePanel(Qt::WindowModality windowModality, QWindow *parent)
 {
-    Q_UNUSED(parent)
-
     createNSOpenSavePanelDelegate();
     if (!mDelegate)
         return false;
     if (windowModality == Qt::NonModal)
         [mDelegate showModelessPanel];
-    // no need to show a Qt::ApplicationModal dialog here, since it will be done in exec;
-    // Qt::WindowModal will be done in execModalForWindow.
+    else if (windowModality == Qt::WindowModal && parent)
+        [mDelegate showWindowModalSheet:parent];
+    // no need to show a Qt::ApplicationModal dialog here, since it will be done in _q_platformRunNativeAppModalPanel()
     return true;
 }
 
@@ -751,14 +745,6 @@ void QCocoaFileDialogHelper::exec()
 
 }
 
-void QCocoaFileDialogHelper::execModalForWindow(QWindow *parent)
-{
-    if (!parent)
-        return exec();
-
-    [mDelegate showWindowModalSheet:parent];
-}
-
 bool QCocoaFileDialogHelper::defaultNameFilterDisables() const
 {
     return true;
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 6676a3ccba683a65524ca437400b8f5e3ab4ea3d..65def6d4b83657532219d3d4360759904d5b9782 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -534,10 +534,7 @@ int QDialog::exec()
 
     QPointer<QDialog> guard = this;
     if (d->nativeDialogInUse) {
-        if (windowModality() == Qt::WindowModal)
-            d->platformHelper()->execModalForWindow(d->parentWindow());
-        else
-            d->platformHelper()->exec();
+        d->platformHelper()->exec();
     } else {
         QEventLoop eventLoop;
         d->eventLoop = &eventLoop;