diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index 4e8b87c41c..b21b7c2cc9 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -236,6 +236,11 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate); [NSApp runModalForWindow:mColorPanel]; mDialogIsExecuting = false; + + // Wake up the event dispatcher so it can check whether the + // current event loop should continue spinning or not. + QCoreApplication::eventDispatcher()->wakeUp(); + return (mResultCode == NSModalResponseOK); } diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index e84d50d729..8bd649e461 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -206,6 +206,10 @@ typedef QSharedPointer SharedPointerFileDialogOptions; auto result = [m_panel runModal]; m_helper->panelClosed(result); + + // Wake up the event dispatcher so it can check whether the + // current event loop should continue spinning or not. + QCoreApplication::eventDispatcher()->wakeUp(); } - (void)closePanel diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index 4fa8ea2721..355d658242 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -218,6 +218,11 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate); [NSApp runModalForWindow:mFontPanel]; mDialogIsExecuting = false; + + // Wake up the event dispatcher so it can check whether the + // current event loop should continue spinning or not. + QCoreApplication::eventDispatcher()->wakeUp(); + return (mResultCode == NSModalResponseOK); }