diff options
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm index 9f4446b32e..99dc3cb94e 100644 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm @@ -343,31 +343,16 @@ QCocoaColorDialogHelper::QCocoaColorDialogHelper() : } QCocoaColorDialogHelper::~QCocoaColorDialogHelper() -{ - deleteNativeDialog_sys(); -} - -void QCocoaColorDialogHelper::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 QCocoaColorDialogHelper::_q_platformRunNativeAppModalPanel() +void QCocoaColorDialogHelper::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(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate); - [delegate runApplicationModalPanel]; - if (dialogResultCode_sys() == QPlatformDialogHelper::Accepted) + if ([delegate runApplicationModalPanel]) emit accept(); else emit reject(); @@ -397,14 +382,6 @@ void QCocoaColorDialogHelper::hide_sys() [reinterpret_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate)->mColorPanel close]; } -QCocoaColorDialogHelper::DialogCode QCocoaColorDialogHelper::dialogResultCode_sys() -{ - if (!mDelegate) - return QPlatformDialogHelper::Rejected; - QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate); - return [delegate dialogResultCode]; -} - void QCocoaColorDialogHelper::setCurrentColor_sys(const QColor &color) { if (!mDelegate) |