summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-01-24 09:09:28 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-01-31 10:39:38 +0100
commita9458a175598a0da0fdfbfed7f9470878af25b72 (patch)
treeb3f1ab77b20a10831bc4890975594a0978ef1c44 /src/gui/image/qimage.cpp
parent539a024819a5f696b8afe899108b409f2b77549c (diff)
Clean up logical dpi for QImage.
Revert to the pre highdpi-patch behaviour. Before, both physical and logical DPI would be based on the dpmx/dpmy variables, which could be changed with setDotsPerMeter(). The highdpi patch introduced separate ldpmx/ldpmy variables, which were not changed by setDotsPerMeter(). This broke when loading images: setDotsPerMeter would be called but the logical dpi would not change. Remove ldpmx/ldpmy. Keep scaling the physical dpi by the devicePixelRatio, which will be set to 1 by default. Task-number: QTBUG-29187 Change-Id: I0d6f5f3b8efae5fb1adc0a50b22a5da78324a282 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r--src/gui/image/qimage.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index de1e555771..975ef54d6b 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -99,8 +99,6 @@ QImageData::QImageData()
format(QImage::Format_ARGB32), bytes_per_line(0),
ser_no(qimage_serial_number.fetchAndAddRelaxed(1)),
detach_no(0),
- ldpmx(qt_defaultDpiX() * 100 / qreal(2.54)),
- ldpmy(qt_defaultDpiY() * 100 / qreal(2.54)),
dpmx(qt_defaultDpiX() * 100 / qreal(2.54)),
dpmy(qt_defaultDpiY() * 100 / qreal(2.54)),
offset(0, 0), own_data(true), ro_data(false), has_alpha_clut(false),
@@ -4984,11 +4982,11 @@ int QImage::metric(PaintDeviceMetric metric) const
return d->depth;
case PdmDpiX:
- return qRound(d->ldpmx * 0.0254);
+ return qRound(d->dpmx * 0.0254);
break;
case PdmDpiY:
- return qRound(d->ldpmy * 0.0254);
+ return qRound(d->dpmy * 0.0254);
break;
case PdmPhysicalDpiX: