C

CMake API changes

The following subsections summarize the CMake-related changes in Qt for MCUs v2.0, compared to v1.9.

CMake API prefixes

Since Qt for MCUs v2.0, the CMake API names follow a naming policy, making it easier to understand their purpose. Depending on whether the intended access for the APIs, they have the following prefixes:

PrefixIntended access
QUL_*Public
QUL_PLATFORM_*Public, for platform developers
QUL_PRIVATE_*Private, internal

See CMake changelog for a list of all the renamed APIs.

Static font engine

It is now possible to explicitly choose a font engine using the QUL_FONT_ENGINE CMake target property. It is by default set to "Static", so no changes are required if you are using the Static font engine.

The QUL_FONTS_DIR target property is removed, so it is no longer possible to provide a directory that contains the fonts. Replace all such instances with the QUL_FONT_FILES CMake target property, listing all used font files explicitly. By default, QUL_FONT_FILES includes all fonts that are shipped with Qt for MCUs. You can either append to this existing list or or replace it.

Qt for MCUs v1.9Qt for MCUs v2.0
set_property(TARGET <target> PROPERTY
    QUL_FONTS_DIR <path to fonts directory>
)
# Optional, QUL_FONT_ENGINE is set to "Static" by default
set_property(TARGET <target> PROPERTY QUL_FONT_ENGINE "Static")

set_property(TARGET <target> PROPERTY QUL_FONT_FILES
    <path to font file>
    <path to another font file>
)

Monotype Spark font engine

In previous versions of Qt for MCUs, it was required to explicitly set the QUL_MONOTYPE_SPARK_FONT_FILE CMake target property to use the Monotype Spark font engine. Since Qt for MCUs 2.0, you should set the QUL_FONT_ENGINE CMake target property to "Spark", and QUL_FONT_FILES to the font file path.

Qt for MCUs v1.9Qt for MCUs v2.0
set_property(TARGET <target> PROPERTY
    QUL_MONOTYPE_SPARK_FONT_FILE <Monotype Spark font file>
)
set_target_properties(<Executable Target> PROPERTIES
    QUL_FONT_ENGINE "Spark"
    QUL_FONT_FILES <Monotype Spark font file>
)

Note: When using Monotype Spark font engine, QUL_FONT_FILES must contain a single entry.

The other CMake target properties that were specific to the Monotype Spark font engine are renamed in Qt for MCUs v2.0. Replace instances of these removed properties with the corresponding alternatives listed in the following table:

Qt for MCUs 1.9Qt for MCUs 2.0
QUL_MONOTYPE_SPARK_CACHE_PRIMINGQUL_FONT_CACHE_PRIMING
QUL_MONOTYPE_SPARK_CACHE_SIZEQUL_FONT_CACHE_SIZE
QUL_MONOTYPE_SPARK_HEAP_SIZEQUL_FONT_HEAP_SIZE
QUL_MONOTYPE_SPARK_VECTOR_OUTLINESQUL_FONT_VECTOR_OUTLINES_DRAWING
QUL_MONOTYPE_SPARK_CACHE_NO_PREALLOCQUL_FONT_CACHE_PREALLOC
QUL_MONOTYPE_SPARK_HEAP_NO_PREALLOCQUL_FONT_HEAP_PREALLOC

QUL_FONT_CACHE_PREALLOC and QUL_FONT_HEAP_PREALLOC expect opposite values when compared to their counterparts in the previous Qt for MCUs version. The following example demonstrates this change well:

Qt for MCUs v1.9Qt for MCUs v2.0
set_target_properties(<Executable Target> PROPERTIES
    QUL_MONOTYPE_SPARK_CACHE_SIZE <size>
    QUL_MONOTYPE_SPARK_CACHE_PRIMING ON
    QUL_MONOTYPE_SPARK_HEAP_SIZE <size>
    QUL_MONOTYPE_SPARK_VECTOR_OUTLINES ON

    QUL_MONOTYPE_SPARK_CACHE_NO_PREALLOC ON
    QUL_MONOTYPE_SPARK_HEAP_NO_PREALLOC ON
)
set_target_properties(<Executable Target> PROPERTIES
    QUL_FONT_CACHE_SIZE <size>
    QUL_FONT_CACHE_PRIMING ON
    QUL_FONT_HEAP_SIZE <size>
    QUL_FONT_VECTOR_OUTLINES_DRAWING ON

    QUL_FONT_CACHE_PREALLOC OFF
    QUL_FONT_HEAP_PREALLOC OFF
)

Resources storage configuration

Since Qt for MCUs v2.0, QUL_COPY_TO_RAM, QUL_GLYPHS_COPY_TO_RAM, and QUL_FONT_FILES_COPY_TO_RAM target properties are removed. Replace all instances of these properties with a corresponding alternative as shown in the following table.

Qt for MCUs v1.9Qt for MCUs v2.0
set_target_properties(<Executable Target> PROPERTIES
    QUL__COPY_TO_RAM "OnStartup"
)
set_target_properties(<target> PROPERTIES
    QUL_RESOURCE_CACHE_POLICY "OnStartup"
    QUL_RESOURCE_STORAGE_SECTION "QulResourceData"
    QUL_RESOURCE_RUNTIME_ALLOCATION_TYPE 128
)
set_target_properties(<Executable Target> PROPERTIES
    QUL_GLYPHS_COPY_TO_RAM "OnStartup"
)
set_target_properties(<target> PROPERTIES
    QUL_GLYPHS_RESOURCE_CACHE_POLICY "OnStartup"
    QUL_GLYPHS_RESOURCE_STORAGE_SECTION "QulResourceData"
    QUL_GLYPHS_RESOURCE_RUNTIME_ALLOCATION_TYPE 128
)
set_target_properties(<Executable Target> PROPERTIES
    QUL_FONT_FILES_COPY_TO_RAM "OnStartup"
)
set_target_properties(<target> PROPERTIES
    QUL_FONT_FILES_RESOURCE_CACHE_POLICY "OnStartup"
    QUL_FONT_FILES_RESOURCE_STORAGE_SECTION "QulResourceData"
    QUL_FONT_FILES_RESOURCE_RUNTIME_ALLOCATION_TYPE 128
)

For more information, see:

Renamed CMake targets

All CMake targets are renamed and simplified in Qt for MCUs v2.0. See the CMake changelog for a list of all the renamed targets.

Qt for MCUs v1.9Qt for MCUs v2.0
target_link_libraries(<target> PRIVATE
    Qul::QuickUltraliteControlsStyleDefault
    Qul::QuickUltraliteTimeline
)
target_link_libraries(<target> PRIVATE
    Qul::Controls
    Qul::Timeline
)

Available under certain Qt licenses.
Find out more.