On this page

C

QUL_RESOURCE_SVG_SCALE

Scaling factor for SVG images.

Description

Scales SVG images by the given factor. The images are scaled while they are processed by Qt Quick Ultralite Tools at compile time. The factor only applies to SVG images that have QUL_RESOURCE_ENABLE_SVG_SCALING set to ON; other images keep their size.

Set the property on an image, or on a target as the default for all the images that the target adds. A value set on an image takes precedence over the target's. Some boards set a default scale for their screen, which both take precedence over.

Set the properties before the images are added to the target.

Example

qul_add_executable(my_app)

# The default scale for the SVG images of my_app
set_target_properties(my_app PROPERTIES QUL_RESOURCE_SVG_SCALE 0.5)

# Only the images that enable scaling are scaled
set_source_files_properties(background.svg icon.svg
    PROPERTIES QUL_RESOURCE_ENABLE_SVG_SCALING ON)

# icon.svg uses its own scale instead of the target's
set_source_files_properties(icon.svg PROPERTIES QUL_RESOURCE_SVG_SCALE 0.25)

qul_add_qml_module(my_app
    URI MyApp
    QML_FILES main.qml
    RESOURCES
        background.svg  # scaled by 0.5
        icon.svg        # scaled by 0.25
        logo.svg        # not scaled, scaling is not enabled for it
)

Since

This property was introduced in Qt Quick Ultralite 3.0.

See also QUL_RESOURCE_ENABLE_SVG_SCALING and Default Resource Properties.

Available under certain Qt licenses.
Find out more.