C

ImageFiles.MCU.resourceCachePolicy

Defines the image cache policy.

Description

This property can be used to choose an image cache policy, which enables faster access to the image assets. The default cache policy varies depending on whether MCU.Config.resourceCompression is true or false.

It is set to "OnDemand" if the resource compression is true, otherwise to "OnStartup".

The following list describes the available options:

ConstantDescription
"OnStartup"The data is copied to RAM on startup. Although this enables faster access to data, it might use up limited RAM.
"OnDemand"The data is copied to the texture cache on demand. This is the default policy if resourceCompression is true. Image caching must be enabled.
"NoCaching"The data is not copied to RAM. Drawing an image to the screen from storage may result in reduced performance.

Usage

This property is accepted in any context where its parent node is accepted. It takes a string.

The available options are:

  • "OnStartup"
  • "NoCaching"
  • "OnDemand"

Code example:

ImageFiles {
    MCU.resourceCachePolicy: "NoCaching"
}

Note: This property can also be applied to every image resource in the QmlProject file if defined in MCU.Config as follows:

MCU.Config {
    resourceCachePolicy: "NoCaching"
}

Since

This property was introduced in QmlProject API 1.3 .

See also Qt Quick Ultralite image caching, ImageFiles.MCU.resourceRuntimeAllocationType, ImageFiles.MCU.resourceStorageSection, Qt Quick Ultralite image caching, ImageFiles.MCU.resourceCompression, MCU.Config.maxResourceCacheSize, and QUL_RESOURCE_CACHE_POLICY.

Available under certain Qt licenses.
Find out more.