QQuickImageBase: fix unnecessary reloads when entering a window
Since 1feb1384a73632c893f421d315953e998a5dcda2, an image is reloaded
when it enters a window with a device pixel ratio other than the one it
was loaded for. But this was determined by comparing the window's DPR
with the image's DPR, which is the DPR of the loaded image, e.g. 1 for
a plain PNG, or 2 for an @2x one. So the image was reloaded every time
it entered a window with a different DPR, e.g. every time a Popup was
opened.
Remember the DPR the image was loaded for instead, and compare against
that. Also reload the image when polishing rather than right away, so
that its signals are not emitted in the middle of reparenting.
Fixes: QTBUG-151353
Pick-to: 6.12
Change-Id: If304e80a63889239667d5c2392f4d79b67885f84
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>