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

Qlabel with scaledContents = true doesn't takes advantage of hi-res QPixmap in a retina display

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.0 Beta
    • 5.3.2
    • None
    • MacOSX Mavericks Qt5.3.2
    • bc1796ff5c34d3dfe0fb20026602bbe4e4aacfad

    Description

      Loading a hi-res Pixmap with the proper devicePixelRatio set in a QLabel with scaledContents = true, downscale the pixmap to the size of the QLabel in pixels, not in points.

      In the RetinaText.pro project attached, a 32x32 image is loaded in a 16x16 QLabel, the result is the same as displaying a 16x16 image (check comments in code).

      In the sample project, a couple of images are loaded using QIcon for retina display support testing, the first button should load a low res image and the second one a high res image in a retina display (works fine).

      Then, three labels are created, the first one should display a high res image, but it doesn't (the one using scaledContents = true). The second one loads the same pixmap and works fine. The third one just loads a low res version of the pixmap, just for testing the visual appareance of a low res pixmap in a retina display.

      I think that in this case, QLabel should be smart enough for knowing that it should use a 32x32 pixmap if it is available when it adjust its content to its size 16x16.

      Attachments

        For Gerrit Dashboard: QTBUG-42503
        # Subject Branch Project Status CR V

        Activity

          People

            sorvig Morten Sørvig
            luisangelsm Luis Ángel San Martín
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes