QQuickAsyncImageProvider not caching
-
According to the documentation QQuickAsyncImageProvider caches images (so I don't have to build that), since its ancestor (QQuickImageProvider) does caching.
I have 2 separate QML files each containing an Image object, both have the identical source value. I have implemented QQuickAsyncImageProvider and notice that the function is being called for EACH image (even after the first retrieved and showed the image). Why?
I saw a number of posts saying to add "cache: true" to Image, but I can't find any such property in the documentation for Image.
-
According to the documentation QQuickAsyncImageProvider caches images (so I don't have to build that), since its ancestor (QQuickImageProvider) does caching.
I have 2 separate QML files each containing an Image object, both have the identical source value. I have implemented QQuickAsyncImageProvider and notice that the function is being called for EACH image (even after the first retrieved and showed the image). Why?
I saw a number of posts saying to add "cache: true" to Image, but I can't find any such property in the documentation for Image.
-
Ok so cache is enabled by default. Then any ideas why QML is retrieving the same image multiple times (no other images being loaded)?
@ocgltd My comment was in the sense of your comment: but I can't find any such property in the documentation for Image, do not point out that it is a solution.
You say: According to the documentation QQuickAsyncImageProvider caches images (so I don't have to build that), since its ancestor (QQuickImageProvider) does caching. Could you point out where it indicates that QQuickAsyncImageProvider has an image cache?
-
@ocgltd My comment was in the sense of your comment: but I can't find any such property in the documentation for Image, do not point out that it is a solution.
You say: According to the documentation QQuickAsyncImageProvider caches images (so I don't have to build that), since its ancestor (QQuickImageProvider) does caching. Could you point out where it indicates that QQuickAsyncImageProvider has an image cache?
@eyllanesc I though a QQuickAsyncImageProvider ancestor includes caching, though I can't find it looking just now. That would be a simple answer if correct.
-
@eyllanesc I though a QQuickAsyncImageProvider ancestor includes caching, though I can't find it looking just now. That would be a simple answer if correct.
@ocgltd I do not understand you. The cache is just your speculation or you saw it somewhere in the Qt documentation. I ask because in your initial comment you say: According to the documentation QQuickAsyncImageProvider but in your last one it seems the opposite.