C

Qt Quick Ultralite minimal Example

Demonstrates a basic Qt Quick Ultralite application setup.

Overview

The minimal example shows the basic Qt Quick Ultralite application setup.

Target platforms

Project structure

The minimal example consists of only three files, CMakeLists.txt, mcu_minimal.qmlproject and minimal.qml.

The CMake project file contains a basic build script, the minimal.qml defines the UI and mcu_minimal.qmlproject contains a simple project configuration to load minimal.qml into the project.

CMake project file
cmake_minimum_required (VERSION 3.21.1)

project(minimal VERSION 0.0.1 LANGUAGES C CXX ASM)
if (NOT TARGET Qul::Core)
    find_package(Qul)
endif()

qul_add_target(minimal QML_PROJECT mcu_minimal.qmlproject GENERATE_ENTRYPOINT)
app_target_setup_os(minimal)

if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32)
    add_custom_command(TARGET minimal
        COMMAND strip minimal -o minimal.stripped
        DEPENDS minimal)
endif()
QmlProject file
import QmlProject 1.3

Project {
        mainFile: "minimal.qml"
        QmlFiles {
                files: [
                        "minimal.qml"
                ]
        }
}
Application UI
import QtQuick 2.15

Rectangle {
    color: "#41CD52"
    Text {
        anchors.centerIn: parent
        font.pixelSize: 30
        text: "Qt for MCUs"
    }
}

Files:

Available under certain Qt licenses.
Find out more.