summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-07-23 13:48:41 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-28 07:56:04 (GMT)
commitba059bc9f908c0794b8749948539a0a8a747f907 (patch)
treeee3ee1070589f9259713db725c6f3fbe806980cb /src
parent0034e1af4acf48d38670b733a095794301cafdd2 (diff)
downloadQt-ba059bc9f908c0794b8749948539a0a8a747f907.zip
Qt-ba059bc9f908c0794b8749948539a0a8a747f907.tar.gz
Qt-ba059bc9f908c0794b8749948539a0a8a747f907.tar.bz2
QPrintDialog OSX: don't crash if ApplicationModal and no parent
Task-number: QTBUG-32464 (backported from qtbase/03855decfcb4e05817424843564a4b66636bb347) Change-Id: I12892798419b2efcf404f972930562d50d045ea3 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/dialogs/qprintdialog_mac.mm4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/dialogs/qprintdialog_mac.mm b/src/gui/dialogs/qprintdialog_mac.mm
index c2c05c6..4cd8e85 100644
--- a/src/gui/dialogs/qprintdialog_mac.mm
+++ b/src/gui/dialogs/qprintdialog_mac.mm
@@ -313,7 +313,9 @@ void QPrintDialogPrivate::openCocoaPrintPanel(Qt::WindowModality modality)
[printPanel setOptions:macOptions];
- if (modality == Qt::ApplicationModal) {
+ if (modality == Qt::ApplicationModal || !q->parentWidget()) {
+ if (modality == Qt::NonModal)
+ qWarning("QPrintDialog is required to be modal on OS X");
int rval = [printPanel runModalWithPrintInfo:ep->printInfo];
[delegate printPanelDidEnd:printPanel returnCode:rval contextInfo:this];
} else {