From 7203e88084a313fb6e7a96b9080f965e3ffcd89f Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 18 Feb 2013 23:19:57 +0100 Subject: Don't enable HIDPI when rendering directly to PDF on Mac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When rendering to PDF using the PDF paint engine on Mac it would consider it to be rendering as HIDPI when ScreenResolution was used. This would mean nothing was being rendered at all in the PDF as a result. Task-number: QTBUG-28709 Change-Id: Ieb97ca9d0b47f6b96debbcf5e05e96c39292e412 Reviewed-by: Morten Johan Sørvig --- src/gui/painting/qpainter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/painting/qpainter.cpp') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 0811b5282f..786136d203 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -229,7 +229,7 @@ QTransform QPainterPrivate::hidpiScaleTransform() const { #ifdef Q_OS_MAC // Limited feature introduction for Qt 5.0.0, remove ifdef in a later release. - if (device->physicalDpiX() == 0 || device->logicalDpiX() == 0) + if (device->devType() == QInternal::Printer || device->physicalDpiX() == 0 || device->logicalDpiX() == 0) return QTransform(); const qreal deviceScale = (device->physicalDpiX() / device->logicalDpiX()); if (deviceScale > 1.0) @@ -1843,7 +1843,7 @@ bool QPainter::begin(QPaintDevice *pd) #ifdef Q_OS_MAC // Limited feature introduction for Qt 5.0.0, remove ifdef in a later release. - const bool isHighDpi = (d->device->physicalDpiX() == 0 || d->device->logicalDpiX() == 0) ? + const bool isHighDpi = (pd->devType() == QInternal::Printer || d->device->physicalDpiX() == 0 || d->device->logicalDpiX() == 0) ? false : (d->device->physicalDpiX() / d->device->logicalDpiX() > 1); #else const bool isHighDpi = false; -- cgit v1.2.3