QPrintDialog OSX: don't crash if ApplicationModal and no parent
Task-number: QTBUG-32464 Change-Id: I5ee2741735255254c17555dfb977ce73941d3e22 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Liang Qi <liang.qi@digia.com>
This commit is contained in:
parent
f2a611ce6c
commit
03855decfc
@ -198,7 +198,9 @@ void QPrintDialogPrivate::openCocoaPrintPanel(Qt::WindowModality modality)
|
||||
qApp->processEvents(QEventLoop::ExcludeUserInputEvents, QEventLoop::ExcludeSocketNotifiers);
|
||||
|
||||
QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) alloc] init];
|
||||
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:printInfo];
|
||||
[delegate printPanelDidEnd:printPanel returnCode:rval contextInfo:q];
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user