Details
-
Suggestion
-
Resolution: Invalid
-
P2: Important
-
4.7.0
-
None
-
Qt 4.7
Description
I have a Image element in my QML, and I use my own ImageProvider as the source, my ImageProvider is a plugin.
Image
{ Id: foregroundImage Source: "image://ownimageprovider/foreground sourceSize.width: mainWidget.imageWidth }My ownimageprovider generate dynamic QImage for Image element, but I don't know how to reload image when image is changed.
I tried to use a stupid way to do: add sourceSize.width property. When I know image is changed from my c++ code, I emit "imageWidthChanged" signal(by increase image width to 1, or minus 1, human cannot see the difference if image size is changed 1 pixel), then image is reloaded. But this solution is not working all the time, only work in some times.
Is there better and robust solution for this?
--------------------------------------------------------------------
Lam Bea's solution:
There is no straightforward way to do this at the moment. The only way to force a reload would be to modify the image url to ensure a new image is requested from the image provider - for example, by appending some unique number that then is ignored by the image provider.
Attachments
Issue Links
- depends on
-
QTBUG-13451 Support property versioning in QML
- Closed
- relates to
-
QTBUG-12704 Suggestion to add a reload function to to qml Image
- Closed