diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-07-23 13:48:41 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-28 07:56:04 (GMT) |
commit | ba059bc9f908c0794b8749948539a0a8a747f907 (patch) | |
tree | ee3ee1070589f9259713db725c6f3fbe806980cb /src | |
parent | 0034e1af4acf48d38670b733a095794301cafdd2 (diff) | |
download | Qt-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.mm | 4 |
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 { |