C

QUL_RESOURCE_RUNTIME_ALLOCATION_TYPE

Define the asset runtime allocation type.

Description

The user can define the type of memory allocation the platform is going to use when accessing the asset.

This property is of integer type and its value has to be greater than or equal to 0 and less than 256. The value has to match the memory allocator types known by the platform, where the range [128,255] is dedicated to user-defined custom allocators.

If not set, the default value depends on the resource cache policy: if the cache policy is set to OnStartup then it will be 3 (DefaultPreload), while if set to OnDemand (or the image is compressed) it will be 1 (Image).

For the OnDemand cache policy it's also necessary to enable Image caching.

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_CACHE_POLICY, QUL_RESOURCE_STORAGE_SECTION, Qt Quick Ultralite image caching, QUL_RESOURCE_COMPRESSION, and Default Resource Properties.

Available under certain Qt licenses.
Find out more.