Qt Quick Ultralite image caching
Qt Quick Ultralite loads all images from flash memory to RAM on startup by default. This approach may limit usable size of RAM and assets size that one can fit into the applications.
The problems can be compensated by caching the images.
How to enable caching of images:
- Set the resource cache size using MCU.Config.maxResourceCacheSize to desired size.
- Set the ImageFiles.MCU.resourceCachePolicy resource property to "OnDemand" for individual files, or make it the default by setting it in
MCU.Configas indicated in the property
The user must choose an appropriate cache size to prevent frequent deletion, which can cause frame drops. The cache size must be at least as big as the biggest single image. Refer to the documentation for MCU.Config.maxResourceCacheSize for more details.
The cache is also used for images that need to be decompressed at runtime.
The image cache size used by the application can be seen in the performance logs.
Refer to Resource cache for tips about choosing an appropriate cache size.
See also ImageFiles.MCU.resourceCompression and MCU.Config.maxResourceCacheSize.
Available under certain Qt licenses.
Find out more.