[Development] High-DPI 5.6 beta update

Sorvig Morten Morten.Sorvig at theqtcompany.com
Wed Dec 16 11:25:00 CET 2015

> On 15 Dec 2015, at 22:16, Tim Blechmann <tim at klingt.org> wrote:
> Hash: SHA256
>>>>> Your thoughts on projects that use ONLY SVG image resources
>>>>> and not PNG/JPEG?
>>>> But the above:
>>>> 1) already works
>>> kind of ... the above will rasterize the svg for the resolution
>>> of the Image which is then upscaled, to match the resolution of
>>> the screen, resulting in a blurry rendering :/
>> What you describe is QTBUG-38991 which we fixed in Qt 5.5 already
> just setting the image source to an svg will still result in a blurry
> rendering in 5.5 and 5.6. i have to work around this by setting the
> source size explicitly, as it doesn't take the devicePixelRatio into
> account …

Yes, as I understand it the way SVG loading works in Qt Quick is that
the SVG image provider will determine the rasterized size if sourceSize
is not set. (In the general, normal-dpi case).

The SVG image provider has of course no idea what the target display is
can can’t account for high-dpi displays.

If you set sourceSize then QQuickImageBase will scale it by the target
devicePixelRatio and you get a high-resolution image.

There are ways to fix this, for example we could ferry the target scale
factor through the image loading and caching layers, down to QImageIOHandler.

This is part of what QTBUG-49820 is about. Before we start fixing I think
we need to make a decision about multi-version images in Qt Quick: do we 
want to add an Icon type and keep Image simple, or go for a single Image 
type handling all such use cases.


More information about the Development mailing list