C
Qt Quick Ultralite Thermostat Demo
Demonstrates a pure QML-based application built using Qt Quick Ultralite.
Overview
This example showcases multiple aspects that developers might face while working on production ready applications:
- Handling different target display resolutions in a single application
- Translating applications built with Qt Quick Ultralite (English, German, Japanese, Arabic, Thai and Hindi)
- Localizing applications by using different units (metric and imperial)
Note: On EK-RA6M3G, this demo uses Static font engine, and languages with complex scripts are disabled.
Benchmark mode
In the Benchmark mode, the application runs for a predefined time of 30 seconds and the performance metrics are displayed on the screen at the end of 30-seconds interval. If the Qt Quick Ultralite Core library is built with QUL_ENABLE_PERFORMANCE_CONSOLE_OUTPUT=ON
, the same results are also displayed on the serial console.
The following performance metrics are displayed at the end of the test:
Parameter | Description | |
---|---|---|
1 | Total frames | Total number of frames in the recording interval. |
2 | Average FPS | Average frames per second value measured during the recording interval. |
3 | Minimum FPS | Minimum frames per second value captured during the recording. |
4 | Maximum heap usage | Maximum heap usage in bytes recorded since the application was started. |
5 | Maximum stack usage | Maximum stack usage in bytes recorded since the application was started. |
6 | Average CPU load | CPU Load in percentage value averaged over the recording interval. |
The Benchmark mode is provided as an independent CMake target with the name thermo_small_benchmark
and thermo_big_benchmark
. To run the Benchmark mode, build and flash the benchmark mode target binary.
The main qmlproject file includes the benchmark_module.qmlproject file as shown below:
ModuleFiles { files: [ "mode/benchmark_module.qmlproject" ] }
Import the following modules in the root QML file.
import QtQuickUltralite.Extras 2.0 import Benchmark 1.0 import QtQuickUltralite.Profiling
- Qt Quick Ultralite Extras module provides QulPerf object which allows starting and stopping the measurements.
Benchmark
module is provided bybenchmark_module.qmlproject
file. It provides methods for simulating touch gesture for flick control.- Qt Quick Ultralite Profiling module provides the screen overlay QulPerfOverlay for displaying performance metrics on top of the application user interface.
Add the QulPerfOverlay
QML object for benchmark results in root qml. This overlay becomes visible when benchmarkTimer
is triggered after 30 seconds.
QulPerfOverlay { id: benchmarkResult anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: parent.verticalCenter; visible: false }
Start the recording in the root QML file, rootqml/+benchmark/thermo.qml
, when the root object is instantiated and Component.onCompleted
signal is triggered.
Component.onCompleted: { QulPerf.recording = true }
The application runs for 30 seconds. The recording is stopped after 30 seconds and benchmark results screen overlay is made visible.
Timer { id: benchmarkTimer interval: 30000 running: true repeat: false onTriggered: { QulPerf.recording = false; benchmarkResult.visible = true } }
Note: The Benchmark mode requires Qt Quick Ultralite Core and Platform libraries to be built with QUL_ENABLE_PERFORMANCE_LOGGING=ON
and QUL_ENABLE_HARDWARE_PERFORMANCE_LOGGING=ON
.
Target platforms
- EK-RA6M3G
- MIMXRT1050
- MIMXRT1060
- MIMXRT1064
- STM32F469i
- STM32F769i
- STM32H750b
Screenshots
Thermostat Demo for small screens
Thermostat Demo for large screens
Files:
- thermo/+big/Theme.qml
- thermo/+small/Theme.qml
- thermo/AnimatedDigit.qml
- thermo/BottomBar.qml
- thermo/CMakeLists.txt
- thermo/Card.qml
- thermo/CardRow.qml
- thermo/FanControlButton.qml
- thermo/LanguageButton.qml
- thermo/LanguageDialog.qml
- thermo/PlacesView.qml
- thermo/PowerSwitch.qml
- thermo/RoomControlButton.qml
- thermo/RoomSchedule.qml
- thermo/RoomView.qml
- thermo/ScheduleView.qml
- thermo/StatsContents.qml
- thermo/StatsView.qml
- thermo/ThermoView.qml
- thermo/TimeIntervalSlider.qml
- thermo/TimeIntervalSliderHandle.qml
- thermo/TopBar.qml
- thermo/WeatherStatus.qml
- thermo/dynamic/Configuration.qml
- thermo/fonts/Spark/FontConfiguration.qml
- thermo/fonts/Static/FontConfiguration.qml
- thermo/imperial/Units.qml
- thermo/imports/Thermo/ColorStyle.qml
- thermo/imports/Thermo/GlobalState.qml
- thermo/imports/Thermo/Room.qml
- thermo/imports/Thermo/Rooms.qml
- thermo/imports/Thermo/qmldir
- thermo/imports/ThermoConfiguration/qmldir
- thermo/metric/Units.qml
- thermo/mode/+benchmark/benchmark_module.qmlproject
- thermo/mode/+benchmark/simulation/flickControl.cpp
- thermo/mode/+benchmark/simulation/flickControl.h
- thermo/mode/+normal/benchmark_module.qmlproject
- thermo/qmlproject/thermo.qmlproject
- thermo/qmlproject/thermo_configuration_module.qmlproject
- thermo/qmlproject/thermo_configuration_module_ek-ra6m3g.qmlproject
- thermo/qmlproject/thermo_ek-ra6m3g.qmlproject
- thermo/qmlproject/thermo_mimxrt1064.qmlproject
- thermo/qmlproject/thermo_module.qmlproject
- thermo/qmlproject/thermo_module_ek-ra6m3g.qmlproject
- thermo/qmlproject/thermo_stm32.qmlproject
- thermo/rootqml/+benchmark/thermo.qml
- thermo/rootqml/+normal/thermo.qml
- thermo/src/os/baremetal/main.cpp
- thermo/static/Configuration.qml
- thermo/thermo.ar_EG.ts
- thermo/thermo.de_DE.ts
- thermo/thermo.en_GB.ts
- thermo/thermo.hi_IN.ts
- thermo/thermo.ja_JP.ts
- thermo/thermo.th_TH.ts
Images:
- thermo/+big/EGYPT.png
- thermo/+big/GERMANY.png
- thermo/+big/INDIA.png
- thermo/+big/JAPAN.png
- thermo/+big/Static/popup-bg.png
- thermo/+big/THAILAND.png
- thermo/+big/UK.png
- thermo/+big/auto-card.png
- thermo/+big/auto-on.png
- thermo/+big/baseline-arrow-back.png
- thermo/+big/btn-bg-big-off.png
- thermo/+big/btn-bg-big-on.png
- thermo/+big/btn-bg-down.png
- thermo/+big/change-language.png
- thermo/+big/close.png
- thermo/+big/digitMaskBottom.png
- thermo/+big/digitMaskTop.png
- thermo/+big/dryer-on-small.png
- thermo/+big/dryer-on.png
- thermo/+big/eco-on-small.png
- thermo/+big/eco-on.png
- thermo/+big/fan-1-on-small.png
- thermo/+big/fan-1-on.png
- thermo/+big/fan-2-on-small.png
- thermo/+big/fan-2-on.png
- thermo/+big/fan-3-on-small.png
- thermo/+big/fan-3-on.png
- thermo/+big/fan-4-on-small.png
- thermo/+big/fan-4-on.png
- thermo/+big/fan-off-small.png
- thermo/+big/fan-off.png
- thermo/+big/jog-off.png
- thermo/+big/jog.png
- thermo/+big/page-indicator.png
- thermo/+big/place-back.png
- thermo/+big/power-on.png
- thermo/+big/pressed-bg-down.png
- thermo/+big/pressed-bg-up.png
- thermo/+big/qt-logo.png
- thermo/+big/radiobutton-checked-pressed.png
- thermo/+big/radiobutton-checked.png
- thermo/+big/radiobutton-disabled.png
- thermo/+big/radiobutton-pressed.png
- thermo/+big/radiobutton.png
- thermo/+big/scrollbar-off-track.png
- thermo/+big/scrollbar-temperature-track.png
- thermo/+big/selected.png
- thermo/+big/separator-line.png
- thermo/+big/slider-handle.png
- thermo/+big/stats-month.png
- thermo/+big/stats-year.png
- thermo/+big/status-small.png
- thermo/+big/streamer-on-small.png
- thermo/+big/streamer-on.png
- thermo/+big/switch-bg.png
- thermo/+big/switch-handle.png
- thermo/+big/switch-i.png
- thermo/+big/switch-o.png
- thermo/+big/temp-down-pressed.png
- thermo/+big/temp-up-pressed.png
- thermo/+big/thermo-handle.png
- thermo/+big/toggle-month.png
- thermo/+big/toggle-year.png
- thermo/+big/top-bar-shadow.png
- thermo/+small/EGYPT.png
- thermo/+small/GERMANY.png
- thermo/+small/INDIA.png
- thermo/+small/JAPAN.png
- thermo/+small/Static/popup-bg.png
- thermo/+small/THAILAND.png
- thermo/+small/UK.png
- thermo/+small/auto-card.png
- thermo/+small/auto-on.png
- thermo/+small/baseline-arrow-back.png
- thermo/+small/btn-bg-big-off.png
- thermo/+small/btn-bg-big-on.png
- thermo/+small/btn-bg-down.png
- thermo/+small/change-language.png
- thermo/+small/close.png
- thermo/+small/digitMaskBottom.png
- thermo/+small/digitMaskTop.png
- thermo/+small/dryer-on-small.png
- thermo/+small/dryer-on.png
- thermo/+small/eco-on-small.png
- thermo/+small/eco-on.png
- thermo/+small/fan-1-on-small.png
- thermo/+small/fan-1-on.png
- thermo/+small/fan-2-on-small.png
- thermo/+small/fan-2-on.png
- thermo/+small/fan-3-on-small.png
- thermo/+small/fan-3-on.png
- thermo/+small/fan-4-on-small.png
- thermo/+small/fan-4-on.png
- thermo/+small/fan-off-small.png
- thermo/+small/fan-off.png
- thermo/+small/jog-off.png
- thermo/+small/jog.png
- thermo/+small/page-indicator.png
- thermo/+small/place-back.png
- thermo/+small/popup-bg.png
- thermo/+small/power-on.png
- thermo/+small/pressed-bg-down.png
- thermo/+small/pressed-bg-up.png
- thermo/+small/qt-logo.png
- thermo/+small/radiobutton-checked-pressed.png
- thermo/+small/radiobutton-checked.png
- thermo/+small/radiobutton-pressed.png
- thermo/+small/radiobutton.png
- thermo/+small/scrollbar-off-track.png
- thermo/+small/scrollbar-temperature-track.png
- thermo/+small/selected.png
- thermo/+small/separator-line.png
- thermo/+small/slider-handle.png
- thermo/+small/stats-month.png
- thermo/+small/stats-year.png
- thermo/+small/status-small.png
- thermo/+small/streamer-on-small.png
- thermo/+small/streamer-on.png
- thermo/+small/switch-bg.png
- thermo/+small/switch-handle.png
- thermo/+small/switch-i.png
- thermo/+small/switch-o.png
- thermo/+small/temp-down-pressed.png
- thermo/+small/temp-up-pressed.png
- thermo/+small/thermo-handle.png
- thermo/+small/toggle-month.png
- thermo/+small/toggle-year.png
- thermo/+small/top-bar-shadow.png
- thermo/SparkFE/+big/popup-bg.png
- thermo/SparkFE/+small/popup-bg.png
- thermo/StaticFE/+big/popup-bg.png
- thermo/StaticFE/+small/popup-bg.png
- thermo/images/card-back-bottomleft.png
- thermo/images/card-back-bottomright.png
- thermo/images/card-back-topleft.png
- thermo/images/card-back-topright.png
- thermo/images/inner-circle.png
- thermo/weather/+big/w_01.png
- thermo/weather/+big/w_02.png
- thermo/weather/+big/w_03.png
- thermo/weather/+big/w_04.png
- thermo/weather/+big/w_05.png
- thermo/weather/+big/w_06.png
- thermo/weather/+big/w_07.png
- thermo/weather/+small/w_01.png
- thermo/weather/+small/w_02.png
- thermo/weather/+small/w_03.png
- thermo/weather/+small/w_04.png
- thermo/weather/+small/w_05.png
- thermo/weather/+small/w_06.png
- thermo/weather/+small/w_07.png
Available under certain Qt licenses.
Find out more.