Details
-
Bug
-
Resolution: Done
-
P2: Important
-
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