summaryrefslogtreecommitdiffstats
path: root/src/printsupport/dialogs
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-03-30 10:11:48 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-12 04:15:35 +0200
commit4800a94c94bdd1491a5dba1c89cf0edbd4b84121 (patch)
treea467d9b15b862882fd78f981069aaa5b871ab75c /src/printsupport/dialogs
parent3a4ed33140bb5dc1b2bf9e783dd26d5fde7c857b (diff)
Cocoa: use specified window modality in native print dialogs
Don't pick the modality type based on the presences of a parent widget, use QWidget::windowModality() instead. If modality hasn't been specified, then use presence of the parent to chose an appropriate modality type. Change-Id: Ib39c166ba3293174c55748f63222367e3e1c56bc Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/printsupport/dialogs')
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_mac.mm8
-rw-r--r--src/printsupport/dialogs/qprintdialog_mac.mm8
2 files changed, 12 insertions, 4 deletions
diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
index e387a58607..1dded4f905 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm
+++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
@@ -179,8 +179,12 @@ void QPageSetupDialog::setVisible(bool visible)
QDialog::setVisible(visible);
if (visible) {
- d->openCocoaPageLayout(parentWidget() ? Qt::WindowModal
- : Qt::ApplicationModal);
+ Qt::WindowModality modality = windowModality();
+ if (modality == Qt::NonModal) {
+ // NSPrintPanels can only be modal, so we must pick a type
+ modality = parentWidget() ? Qt::WindowModal : Qt::ApplicationModal;
+ }
+ d->openCocoaPageLayout(modality);
return;
} else {
if (d->pageLayout) {
diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm
index 8ea3c9a11d..e1d85eed59 100644
--- a/src/printsupport/dialogs/qprintdialog_mac.mm
+++ b/src/printsupport/dialogs/qprintdialog_mac.mm
@@ -296,8 +296,12 @@ void QPrintDialog::setVisible(bool visible)
QDialog::setVisible(visible);
if (visible) {
- d->openCocoaPrintPanel(parentWidget() ? Qt::WindowModal
- : Qt::ApplicationModal);
+ Qt::WindowModality modality = windowModality();
+ if (modality == Qt::NonModal) {
+ // NSPrintPanels can only be modal, so we must pick a type
+ modality = parentWidget() ? Qt::WindowModal : Qt::ApplicationModal;
+ }
+ d->openCocoaPrintPanel(modality);
return;
} else {
if (d->printPanel) {