Qt Quick Ultralite 最小范例

Demonstrates a basic Qt Quick Ultralite application setup.

概述

minimal example shows the basic Qt Quick Ultralite application setup.

目标平台

工程结构

The minimal example consists of only two files, CMakeLists.txt and minimal.qml .

The CMake project file contains a basic build script and the minimal.qml defines the UI.

CMake 工程文件
cmake_minimum_required (VERSION 3.15)
project(minimal VERSION 0.0.1 LANGUAGES C CXX ASM)
if (NOT TARGET Qul::QuickUltralite)
    find_package(Qul)
endif()
qul_add_target(minimal)
qul_target_qml_sources(minimal minimal.qml)
app_target_setup_os(minimal)
app_target_default_entrypoint(minimal minimal)
if(NOT CMAKE_CROSSCOMPILING AND NOT WIN32)
    add_custom_command(TARGET minimal
        COMMAND strip minimal -o minimal.stripped
        DEPENDS minimal)
endif()
							
应用程序 UI
import QtQuick 2.15
Rectangle {
    color: "#41CD52"
    Text {
        anchors.centerIn: parent
        font.pixelSize: 30
        text: "Qt for MCUs"
    }
}
							

文件: