Refresh QML Image
-
in my application i have an Image with source: "........"
and a button beside to let the user the option to replace it with other image.
in my qml file I added a function reload to the image as follow:
@
....
....
Image{
....
....
source: "img.png"
function reload()
{
source = ""
source = "img.png"
//the same path and name as before when user ask to replace the image I change the name of the image to be like the old image and overwrite the old image with the renamed image
}
}
this works fine on windows (7) but on MAC it fail
some one know why?
Thanks
@ -
Either a bug, or caching. Add this line to the definition:
@
cache: false
@ -
-
Hello
It is known bug
http://qt-project.org/forums/viewthread/7093 -
Try to extract image source to property. than change this property.
@
property string src: "img.png"
Image{
source: src
function reload()
{
src = "img1.png"
}
@