summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-02-18 23:19:57 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-19 21:25:16 +0100
commit7203e88084a313fb6e7a96b9080f965e3ffcd89f (patch)
tree7d53936dde26869f3102cdc2f5b269f80dc58487 /src/gui/painting
parent3f99983e76d359cb45b15ae96150d4cc798b61c7 (diff)
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>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qpainter.cpp4
1 files changed, 2 insertions, 2 deletions
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;