Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-18154

Symbian's QPixmap::logicalDpi[X\Y]() incorrectly returns MAXINT.

XMLWordPrintable

    • 48629ab39aa4e20b21a359dc251569a98606983d

      While searching for the reason of QTBUG-17628 (huge fonts in some cases), I found that QS60PixmapData::metric(QPaintDevice::PdmDpiY) always returns MAXINT.
      The reason seems to be that QS60PixmapData::cfbsBitmap.SizeInTwips() returns 0 which gets divided by another value to get the dpi, resulting in 0/x == MAXINT. The dpi value on an XM5800 should be 231, instead if MAXINT(2147483647). Huge Dpi's lead to huge fonts, if the font size is defined in points (QTBUG-17628).

      QImage::logicalDpiY() always returns the correct value.
      Edit: This only happens with graphicssystem "raster". So, on Symbian^3 it only happens when forcing the usage of raster.

      See the snippet (output of the attached test program):

      QImage im(100, 100);
      im.logicalDpiX(); // 231
      im.logicalDpiY(); // 231
      
      QPixmap pm(100, 100);
      pm.logicalDpiX(); // 2147483647
      pm.logicalDpiY(); // 2147483647
      

      Btw.: A very esoteric fact is that 2^31 - 1 == 2147483647 (231 == dpi on XM5800). So, the returned dpi by QPixmap::logicalDpiY() is somehow related to the expected 231

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            agocs Laszlo Agocs (Inactive)
            portale Alessandro Portale
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes