diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm index 515bc2a6ee..89501f7c9d 100644 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm @@ -362,31 +362,16 @@ QCocoaFontDialogHelper::QCocoaFontDialogHelper() : } QCocoaFontDialogHelper::~QCocoaFontDialogHelper() -{ - deleteNativeDialog_sys(); -} - -void QCocoaFontDialogHelper::platformNativeDialogModalHelp() -{ - // Do a queued meta-call to open the native modal dialog so it opens after the new - // event loop has started to execute (in QDialog::exec). Using a timer rather than - // a queued meta call is intentional to ensure that the call is only delivered when - // [NSApp run] runs (timers are handeled special in cocoa). If NSApp is not - // running (which is the case if e.g a top-most QEventLoop has been - // interrupted, and the second-most event loop has not yet been reactivated (regardless - // if [NSApp run] is still on the stack)), showing a native modal dialog will fail. - QTimer::singleShot(1, this, SIGNAL(launchNativeAppModalPanel())); -} +{ } -void QCocoaFontDialogHelper::_q_platformRunNativeAppModalPanel() +void QCocoaFontDialogHelper::exec_sys() { - // TODO: -#if 0 - QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active); -#endif + // Note: If NSApp is not running (which is the case if e.g a top-most + // QEventLoop has been interrupted, and the second-most event loop has not + // yet been reactivated (regardless if [NSApp run] is still on the stack)), + // showing a native modal dialog will fail. QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *>(mDelegate); - [delegate runApplicationModalPanel]; - if (dialogResultCode_sys() == QPlatformDialogHelper::Accepted) + if ([delegate runApplicationModalPanel]) emit accept(); else emit reject(); @@ -416,14 +401,6 @@ void QCocoaFontDialogHelper::hide_sys() [reinterpret_cast<QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *>(mDelegate)->mFontPanel close]; } -QCocoaFontDialogHelper::DialogCode QCocoaFontDialogHelper::dialogResultCode_sys() -{ - if (!mDelegate) - return QPlatformDialogHelper::Rejected; - QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *>(mDelegate); - return [delegate dialogResultCode]; -} - void QCocoaFontDialogHelper::setCurrentFont_sys(const QFont &font) { NSFontManager *mgr = [NSFontManager sharedFontManager]; |