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>