summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qprintengine_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qprintengine_mac.mm')
-rw-r--r--src/gui/painting/qprintengine_mac.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/painting/qprintengine_mac.mm b/src/gui/painting/qprintengine_mac.mm
index 3d5d1d5..a548225 100644
--- a/src/gui/painting/qprintengine_mac.mm
+++ b/src/gui/painting/qprintengine_mac.mm
@@ -114,8 +114,11 @@ bool QMacPrintEngine::end()
Q_D(QMacPrintEngine);
if (d->state == QPrinter::Aborted)
return true; // I was just here a function call ago :)
- if(d->paintEngine->type() == QPaintEngine::CoreGraphics)
+ if(d->paintEngine->type() == QPaintEngine::CoreGraphics) {
+ // We dont need the paint engine to call restoreGraphicsState()
+ static_cast<QCoreGraphicsPaintEngine*>(d->paintEngine)->d_func()->stackCount = 0;
static_cast<QCoreGraphicsPaintEngine*>(d->paintEngine)->d_func()->hd = 0;
+ }
d->paintEngine->end();
if (d->state != QPrinter::Idle)
d->releaseSession();