C

Defining default variables for the platform

A QML project config file has to be created to define the default variables for your platform.

A platform port can have more than one BoardDefaults.qmlprojectconfig file depending on different board or display configurations. To support all those configurations, use the following naming convention:

BoardDefaults_<color_depth>bpp<_default>.qmlprojectconfig

where:

  • The color_depth value should be set to the QUL_COLOR_DEPTH CMake variable. This value is also used to choose between the available configurations, when there are multiple qmlprojectconfig files in the platform cmake directory.
  • If there are multiple configurations, use the default keyword for one of them to indicate the default configuration.

The following table describes different example scenarios and the corresponding configuration file name:

ScenarioBehavior
Only one BoardDefaults.qmlprojectconfig file exists.
  • 📁 cmake
    • 🗎 BoardDefaults.qmlprojectconfig
In a scenario like this where color_depth information is not part of the file name, explicitly provide the QUL_COLOR_DEPTH option to the CMake command.
Only one BoardDefaults_<color_depth>.qmlprojectconfig file exist.
  • 📁 cmake
    • 🗎 BoardDefaults_32bpp.qmlprojectconfig
When using configurations that include the color_depth information in the file name, there is no need to provide the -DQUL_COLOR_DEPTH option to the CMake command.
Multiple BoardDefaults_<color_depth>.qmlprojectconfig files exist. None of them contains the default keyword.
  • 📁 cmake
    • 🗎 BoardDefaults_8bpp.qmlprojectconfig
    • 🗎 BoardDefaults_16bpp.qmlprojectconfig
    • 🗎 BoardDefaults_32bpp.qmlprojectconfig
In this scenario where multiple qmlprojectconfig files include the color_depth information in the file name, explicitly provide the QUL_COLOR_DEPTH option to the CMake command.
Multiple BoardDefaults_<color_depth>.qmlprojectconfig files exist. One of them contains the default keyword.
  • 📁 cmake
    • 🗎 BoardDefaults_8bpp_default.qmlprojectconfig
    • 🗎 BoardDefaults_16bpp.qmlprojectconfig
    • 🗎 BoardDefaults_32bpp.qmlprojectconfig
When one of the configurations contains the default keyword in the file name, it will be picked automatically. To choose a different one, explicitly provide the QUL_COLOR_DEPTH option to the CMake command.

Note: If the qmlprojectconfig file is not named according to the convention, explicitly provide the -DQUL_PLATFORM_BOARD_DEFAULTS_QMLPROJECTCONFIG=<path_to_qmlprojectconfig_file> option to the CMake command.

A minimal configuration file is shown below. IT should specify at least the color formats to be used for your platform:

import QmlProject 1.2

Project {
    MCU.Config {
        platformAlphaPixelFormat: "ARGB8888"
        platformOpaquePixelFormat: "RGB565"
    }
}

For an explanation of these as well as for more options, see QmlProject Manual.

Available under certain Qt licenses.
Find out more.