Cocoa color dialog: Make sure hide() exits the modal session
Change-Id: I708011f3a8ce507e6ade98bf99ad0f5d7b160751 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>bb10
parent
2713a4534b
commit
c92d1d8acd
|
|
@ -295,6 +295,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
|
|||
// close down during the cleanup.
|
||||
qApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers);
|
||||
[NSApp runModalForWindow:mColorPanel];
|
||||
mDialogIsExecuting = false;
|
||||
return (mResultCode == NSOKButton);
|
||||
}
|
||||
|
||||
|
|
@ -384,7 +385,13 @@ void QCocoaColorDialogHelper::hide()
|
|||
{
|
||||
if (!mDelegate)
|
||||
return;
|
||||
[reinterpret_cast<QNSColorPanelDelegate *>(mDelegate)->mColorPanel close];
|
||||
QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
|
||||
if (![delegate->mColorPanel isVisible])
|
||||
return;
|
||||
if (delegate->mDialogIsExecuting)
|
||||
[delegate->mColorPanel performClose:delegate];
|
||||
else
|
||||
[delegate->mColorPanel close];
|
||||
}
|
||||
|
||||
void QCocoaColorDialogHelper::setCurrentColor(const QColor &color)
|
||||
|
|
|
|||
Loading…
Reference in New Issue