QQuickImageBase: reload image when entering a window with different DPR


An image that is loaded before its item has a window (e.g. the content
of a Popup, which is not attached to a window until the popup is
opened) is loaded for qApp->devicePixelRatio(), i.e. the maximum DPR
over all screens. When the item is later attached to a window, only
ItemSceneChange is sent, and the image was never reloaded for the
actual DPR of that window. As a result, scalable images were
rasterized at the wrong size and the wrong @Nx variant was picked for
raster images.

Reload the image on ItemSceneChange if the new window's DPR differs
from the one the image was loaded for, similar to how
ItemDevicePixelRatioHasChanged is handled.

Fixes: QTBUG-150992
Pick-to: 6.12
Change-Id: I630eef94d4a93f34cadc5589818fe4a9f3d7b583
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
commit1feb1384a73632c893f421d315953e998a5dcda2
parent48155471cc76cc906c091215b54e9619108a854d
authorVladimir Belyavsky <belyavskyv@gmail.com>
committerVladimir Belyavsky <belyavskyv@gmail.com>
commit timeFri, 9 Oct 2026 17:56:04 +0000