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

Qml Image in Quick no longer supports Retina/HiDpi

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.3.0 RC1
    • 5.2.0
    • None
    • Mac Os Mavericks
    • 63fb30eb29c26cd7ba0d9133610acb85cad83775

    Description

      When porting our application from QtDeclarative to Quick2.0, we noticed that images are no longer loading their higher resolution alternatives (@2x images). Instead we are getting the low resolution image.

      Same images loaded in a QWidget load the @2x image properly.

      Steps to reproduce:
      1. Create an image (image.png), and a double resolution version (image@2x.png) with some obvious difference (we drew an x on the image).
      2. Place both in the qrc
      3. After creating your QApplication, make sure to set the AA_Use_HighDpiPixmaps attribute
      > mainApplication.setAttribute(Qt::AA_UseHighDpiPixmaps);
      4. Create a layout with a Widget displaying an image side by side with a QQuickView, wrapper in a container QWidget.
      5. Load the image on the QWidgets side. We used QIcon("image.png").pixmap(100,100), to load the pixmap.
      6. Load your qml in the QQuickView using an image tag that loads the dame image.png

      Note, on the Widget side, the image will render the retina version when on a hidpi display, but the qml side will always show the low resolution. Side by side the effect is rather jarring on a desktop application

      Attachments

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

        Activity

          People

            sorvig Morten Sørvig
            atifm Atif Mahmood
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes