Cocoa: fix crash when using QPrintDialog

The contextInfo passed to printPanelDidEnd should be a QPrintDialog*,
not a QPrintDialogPrivate*.

Change-Id: I8f9aae2f27b483b4669f9d39cdafd0ddeb37fd22
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
This commit is contained in:
Bradley T. Hughes 2012-03-20 09:18:30 +01:00 committed by Qt by Nokia
parent b936b95965
commit 83a6435595

View File

@ -206,7 +206,7 @@ void QPrintDialogPrivate::openCocoaPrintPanel(Qt::WindowModality modality)
QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QCocoaPrintPanelDelegate) alloc] init];
if (modality == Qt::ApplicationModal) {
int rval = [printPanel runModalWithPrintInfo:printInfo];
[delegate printPanelDidEnd:printPanel returnCode:rval contextInfo:this];
[delegate printPanelDidEnd:printPanel returnCode:rval contextInfo:q];
} else {
Q_ASSERT(q->parentWidget());
QWindow *parentWindow = q->parentWidget()->windowHandle();
@ -215,7 +215,7 @@ void QPrintDialogPrivate::openCocoaPrintPanel(Qt::WindowModality modality)
modalForWindow:window
delegate:delegate
didEndSelector:@selector(printPanelDidEnd:returnCode:contextInfo:)
contextInfo:this];
contextInfo:q];
}
}