As most people familiar with QML know, there is no builtin "refresh" functionality in QML Image
.
I would like to create a new QML type, say RefreshableImage
to alleviate this problem without resorting to changing the source, which I feel is an ugly hack, as it bleeds into all layers of the Model-View relationship and this switching behaviour is unnatural. Additionally, setting a different source
on an Image
breaks any binding that may have been set (which is really the core of the problem: I want an updateable image that maintains its binding, and is isolated to QML). I understand I'll need to call some signal to actually refresh the image, that's fine.
I have trouble finding documentation on a way to extend Qt's own Image
so that I can force it to reload its source. I would like to avoid writing a complete component that mostly badly replicates Image
to add one function. Is there a way to extend a builtin component like I have in mind?
Minor notes:
- due to external circumstances, I'm limited to Qt 5.5.
- We use as
source
a UUID of the underlying image object which is used by anQQuickImageProvider
to get the actualQImage
. Hence I don't want to change this when updating an image.
Image
with samesource
etc.? Isn't that the same image? – folibis