Don't enable HIDPI when rendering directly to PDF on Mac

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 <morten.sorvig@digia.com>
This commit is contained in:
Andy Shaw 2013-02-18 23:19:57 +01:00 committed by The Qt Project
parent 3f99983e76
commit 7203e88084

View File

@ -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;