Ignore:
Timestamp:
May 16, 2011, 4:09:34 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/image/qpixmap_s60.cpp

    r846 r865  
    600600}
    601601
     602Q_GUI_EXPORT int qt_defaultDpiX();
     603Q_GUI_EXPORT int qt_defaultDpiY();
     604
    602605int QS60PixmapData::metric(QPaintDevice::PaintDeviceMetric metric) const
    603606{
     
    610613    case QPaintDevice::PdmHeight:
    611614        return cfbsBitmap->SizeInPixels().iHeight;
    612     case QPaintDevice::PdmWidthMM: {
    613         TInt twips = cfbsBitmap->SizeInTwips().iWidth;
    614         return (int)(twips * (25.4/KTwipsPerInch));
    615     }
    616     case QPaintDevice::PdmHeightMM: {
    617         TInt twips = cfbsBitmap->SizeInTwips().iHeight;
    618         return (int)(twips * (25.4/KTwipsPerInch));
    619     }
     615    case QPaintDevice::PdmWidthMM:
     616        return qRound(cfbsBitmap->SizeInPixels().iWidth * 25.4 / qt_defaultDpiX());
     617    case QPaintDevice::PdmHeightMM:
     618        return qRound(cfbsBitmap->SizeInPixels().iHeight * 25.4 / qt_defaultDpiY());
    620619    case QPaintDevice::PdmNumColors:
    621620        return TDisplayModeUtils::NumDisplayModeColors(cfbsBitmap->DisplayMode());
    622621    case QPaintDevice::PdmDpiX:
    623     case QPaintDevice::PdmPhysicalDpiX: {
    624         TReal inches = cfbsBitmap->SizeInTwips().iWidth / (TReal)KTwipsPerInch;
    625         TInt pixels = cfbsBitmap->SizeInPixels().iWidth;
    626         return pixels / inches;
    627     }
     622    case QPaintDevice::PdmPhysicalDpiX:
     623        return qt_defaultDpiX();
    628624    case QPaintDevice::PdmDpiY:
    629     case QPaintDevice::PdmPhysicalDpiY: {
    630         TReal inches = cfbsBitmap->SizeInTwips().iHeight / (TReal)KTwipsPerInch;
    631         TInt pixels = cfbsBitmap->SizeInPixels().iHeight;
    632         return pixels / inches;
    633     }
     625    case QPaintDevice::PdmPhysicalDpiY:
     626        return qt_defaultDpiY();
    634627    case QPaintDevice::PdmDepth:
    635628        return TDisplayModeUtils::NumDisplayModeBitsPerPixel(cfbsBitmap->DisplayMode());
Note: See TracChangeset for help on using the changeset viewer.