C

QUL_RESOURCE_CACHE_POLICY

Warning: This CMake source property is deprecated since 2.4, consider using ImageFiles.MCU.resourceCachePolicy instead.

Note: Board defaults can be set using QmlProject in the BoardDefaults.qmlprojectconfig files. See Defining default variables for the platform and QmlProject Manual.

Define the image cache policy.

Description

The following is a list of possible values:

ValueResult
"OnStartup"The data is copied to RAM on startup. Although this enables faster access to data, it might use up your limited RAM.
"OnDemand"The data is copied to the texture cache on demand. 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.

If image data is compressed (QUL_RESOURCE_COMPRESSION), the default value is "OnDemand", otherwise it is "OnStartup".

Note: Source file properties must be set before adding files to the application using the qul_add_resource function.

Example

# Setting an image to be cached on demand with a custom memory allocator
set_source_files_properties(
    big/button.png PROPERTIES
    QUL_RESOURCE_CACHE_POLICY "OnDemand"
    QUL_RESOURCE_STORAGE_SECTION "CustomSegment"
    QUL_RESOURCE_RUNTIME_ALLOCATION_TYPE "128"
)

Since

This property was introduced in Qt Quick Ultralite 2.0.

See also QUL_RESOURCE_RUNTIME_ALLOCATION_TYPE, QUL_RESOURCE_STORAGE_SECTION, Qt Quick Ultralite image caching, QUL_RESOURCE_COMPRESSION, Default Resource Properties, and qul_set_maximum_resource_cache_size.

Available under certain Qt licenses.
Find out more.