[Interest] SVG is loaded with invalid dimensions on some machines

Alexander Dyagilev alervdvcw at gmail.com
Thu Apr 18 17:10:02 CEST 2024


Well, I was able to reproduce the issue.
1. Launch app.
2. Change system zoom settings from 100% to 125%.
3. Done. The issue is here. After restarting app - issue is not reproduced.
So, just a guess, on 2-monitor system this zoom settings changes at runtime
(maybe app is started initially on some monitor and then moves to another
one with different zoom setting).
*Question is*: is it possible to disable this auto-zoom thing for a
particular image or at least globally?

On Thu, Apr 18, 2024 at 9:52 PM Alexander Dyagilev <alervdvcw at gmail.com>
wrote:

> Hello,
>
> The user with the issue has two monitors connected to his PC. *Weird
> thing* is that SVG is loaded properly on one monitor (2K) and improperly
> on another one (FullHD). How can this be? Only Qt authors can probably shed
> some light on this issue :)
>
>
> On Thu, Apr 18, 2024 at 11:24 AM Alexander Dyagilev <alervdvcw at gmail.com>
> wrote:
>
>> Image as it's displayed on the user's machine:
>>
>> [image: image.png]
>>
>>
>> On Thu, Apr 18, 2024 at 11:21 AM Alexander Dyagilev <alervdvcw at gmail.com>
>> wrote:
>>
>>> I forgot to mention that this happens at least with Qt 6.4.3 and 6.6.2
>>> (or 6.6.3 I don't remember exactly). We use this code to load the image:
>>>
>>> import QtQuick 2.12
>>>
>>> Image
>>> {
>>>     property double zoom: 1.0
>>>
>>>     readonly property int preferredWidth: sameHiddenImg.implicitWidth *
>>> zoom
>>>     readonly property int preferredHeight: sameHiddenImg.implicitHeight
>>> * zoom
>>>
>>>     // it works buggy under e.g. Retina displays without this
>>>     width: preferredWidth
>>>     height: preferredHeight
>>>
>>>     // it works buggy under e.g. Retina displays without this
>>>     sourceSize: Qt.size(width, height)
>>>
>>>     Image
>>>     {
>>>         id: sameHiddenImg
>>>         visible: false
>>>         source: parent.source
>>>     }
>>> }
>>>
>>> So, valid values for preferredWidth and preferredHeight are 93 and 456.
>>> But for some rare users they are 116 and 570 accordingly.
>>>
>>> On Thu, Apr 18, 2024 at 11:16 AM Alexander Dyagilev <alervdvcw at gmail.com>
>>> wrote:
>>>
>>>> Hello,
>>>>
>>>> A few of our users have issues with UI rendering. We SVG sprite to
>>>> display some elements of our UI. This SVG has a size specified in it
>>>> (93x456). And of course we rely on it. The issue is that sometimes it's
>>>> loaded with 116x570 size due to some unknown reason. So it's like a
>>>> different image and we can't use such a sprite properly anymore.
>>>>
>>>> What can be the cause of that? I've attached this sprite image.
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240418/2b288e03/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 38585 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20240418/2b288e03/attachment-0001.png>


More information about the Interest mailing list