diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-17 20:46:18 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-03-17 20:46:18 (GMT) |
commit | 8e26d4b87ad5e2e61d7692af5ee5040caa6ef71a (patch) | |
tree | 68ea264ebbdc1b9f63b5c2f8d28941b82fff55ad /src/gui/image | |
parent | cbf6c5b810316efba3ccfb27f05576b8dbfe3890 (diff) | |
parent | 9d63852e31674eb5de2da5cb57a09aff31aabb31 (diff) | |
download | Qt-8e26d4b87ad5e2e61d7692af5ee5040caa6ef71a.zip Qt-8e26d4b87ad5e2e61d7692af5ee5040caa6ef71a.tar.gz Qt-8e26d4b87ad5e2e61d7692af5ee5040caa6ef71a.tar.bz2 |
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration:
PathView doesn't update if preferred highlight range changes.
Image.PreserveAspectFit has unexpected effect on Image's sourceSize
Doc improvement for Image.fillMode.
QDeclarativeView flickers when composited on MeeGo
Re-enable lineHeight tests.
Fix for wrong dpi metrics for raster pixmaps on Symbian.
Introduce QGraphicsItem::ItemStopsFocusHandling flag
Qt.include() used in WorkerScript is broken on Windows.
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index fbdebf3..32d8dd7 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -601,6 +601,9 @@ bool QS60PixmapData::scroll(int dx, int dy, const QRect &rect) return res; } +Q_GUI_EXPORT int qt_defaultDpiX(); +Q_GUI_EXPORT int qt_defaultDpiY(); + int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const { if (!cfbsBitmap) @@ -611,28 +614,18 @@ int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const return cfbsBitmap->SizeInPixels().iWidth; case QPaintDevice::PdmHeight: return cfbsBitmap->SizeInPixels().iHeight; - case QPaintDevice::PdmWidthMM: { - TInt twips = cfbsBitmap->SizeInTwips().iWidth; - return (int)(twips * (25.4/KTwipsPerInch)); - } - case QPaintDevice::PdmHeightMM: { - TInt twips = cfbsBitmap->SizeInTwips().iHeight; - return (int)(twips * (25.4/KTwipsPerInch)); - } + case QPaintDevice::PdmWidthMM: + return qRound(cfbsBitmap->SizeInPixels().iWidth * 25.4 / qt_defaultDpiX()); + case QPaintDevice::PdmHeightMM: + return qRound(cfbsBitmap->SizeInPixels().iHeight * 25.4 / qt_defaultDpiY()); case QPaintDevice::PdmNumColors: return TDisplayModeUtils::NumDisplayModeColors(cfbsBitmap->DisplayMode()); case QPaintDevice::PdmDpiX: - case QPaintDevice::PdmPhysicalDpiX: { - TReal inches = cfbsBitmap->SizeInTwips().iWidth / (TReal)KTwipsPerInch; - TInt pixels = cfbsBitmap->SizeInPixels().iWidth; - return pixels / inches; - } + case QPaintDevice::PdmPhysicalDpiX: + return qt_defaultDpiX(); case QPaintDevice::PdmDpiY: - case QPaintDevice::PdmPhysicalDpiY: { - TReal inches = cfbsBitmap->SizeInTwips().iHeight / (TReal)KTwipsPerInch; - TInt pixels = cfbsBitmap->SizeInPixels().iHeight; - return pixels / inches; - } + case QPaintDevice::PdmPhysicalDpiY: + return qt_defaultDpiY(); case QPaintDevice::PdmDepth: return TDisplayModeUtils::NumDisplayModeBitsPerPixel(cfbsBitmap->DisplayMode()); default: |