summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-06-14 12:39:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-15 19:06:21 +0200
commite083aede62a23af8330bb572366e79e2f42e0cec (patch)
tree760c32913a284dc905bca46dd1edc9a4ac8dce8c /src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
parentcf98d1e60764e22e2e3f168708818106af99c498 (diff)
Cocoa color dialog cannot be modal, but should show anyway
Silently failing doesn't seem the right way to handle this. Updated docs for DontUseNativeDialog option: it's not just for the Mac anymore. Ensure that the Qt dialog and Mac panel will never be shown at the same time. Change-Id: Ia9e80754df6c7622d9039c8dd050ac4de771a030 Task-number: QTBUG-29161 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index 514ea0482f..901aa667f5 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -368,10 +368,8 @@ void QCocoaColorDialogHelper::exec()
bool QCocoaColorDialogHelper::show(Qt::WindowFlags, Qt::WindowModality windowModality, QWindow *parent)
{
- if (windowModality == Qt::WindowModal) {
- // Cocoa's shared color panel cannot be shown as a sheet
- return false;
- }
+ if (windowModality == Qt::WindowModal)
+ windowModality = Qt::ApplicationModal;
return showCocoaColorPanel(windowModality, parent);
}
@@ -434,9 +432,9 @@ bool QCocoaColorDialogHelper::showCocoaColorPanel(Qt::WindowModality windowModal
createNSColorPanelDelegate();
QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate);
[delegate->mColorPanel setShowsAlpha:options()->testOption(QColorDialogOptions::ShowAlphaChannel)];
- if (windowModality == Qt::NonModal)
+ if (windowModality != Qt::WindowModal)
[delegate showModelessPanel];
- // no need to show a Qt::ApplicationModal dialog here, since it will be done in _q_platformRunNativeAppModalPanel()
+ // no need to show a Qt::WindowModal dialog here, because it's necessary to call exec() in that case
return true;
}