C
Qt Quick Ultralite Motorcycle Cluster Demo
Demonstrates integrating QML and C++, and handling multiple variants of the same design.
Overview
The application demonstrates a Motorcycle Instrument Cluster supporting two different screen configurations: 800x480px and 720x1200px. It is possible to switch between configurations using the SIZE_VARIANT cmake variable. Leaving it undefined lets the project's CMakeLists.txt
determine the best size variant for the platform used. Setting it to big
will produce binaries supporting a resolution of 720x1200px. Setting it to anything else results in an application with a resolution of 800x480px.
For example:
cmake .. -DSIZE_VARIANT=big -DQul_ROOT=$QUL_ROOT -DQUL_PLATFORM=qt
When exporting the demo using qmlprojectexporter
, add "big"
to the --selector command-line argument to use the higher resolution file variants:
qmlprojectexporter --selector big demos/motor_cluster/qmlproject/motor_cluster.qmlproject
If a platform has enough storage, the application can have a start-up animation with image sequences. The intro
variant enables the animation, so its .qmlproject
file lists the image files for the animation. This variant is available for the small
variant on STM32F769i-discovery and on the desktop platform. Refer to Resource properties and Resource properties for sprite animation sections which explains how to manage resource for image sequences.
Since Qt Quick Ultralite 2.7, this demo uses screen rotation to rotate the application for the NXP MIMXRT1170 platform. To enable this feature, this platform has its own top-level .qmlproject
file.
The demo shows how to connect a C++ simulation backend to the QML user interface.
The application contains:
- start-up animation (only in
intro
variant) - welcome animation
- driving cycle
- day mode
- navigation with keyboard
- warnings
- goodbye animation
Target platforms
- MCIMX93
- MIMXRT1170 (rotated
big
variant) - RH850-D1M1A (
small
variant) - STM32F769i-discovery (
small
andintro
variant) - Infineon TRAVEO T2G (
small
variant)
Screenshots
Start-up animation
Night Mode
Day Mode
Keyboard
Files:
- motor_cluster/CMakeLists.txt
- motor_cluster/imports/MotorCluster/qmldir
- motor_cluster/qmlproject/+big/+intro/motor_cluster_module.qmlproject
- motor_cluster/qmlproject/+big/motor_cluster_module.qmlproject
- motor_cluster/qmlproject/+ek-ra6m3g/motor_cluster_module.qmlproject
- motor_cluster/qmlproject/+qt/motor_cluster_module.qmlproject
- motor_cluster/qmlproject/+rh850/motor_cluster_module.qmlproject
- motor_cluster/qmlproject/+stm32f769/motor_cluster_module.qmlproject
- motor_cluster/qmlproject/+traveo-t2g-cyt4en/motor_cluster_module.qmlproject
- motor_cluster/qmlproject/+traveo-t2g/motor_cluster_module.qmlproject
- motor_cluster/qmlproject/motor_cluster.qmlproject
- motor_cluster/qmlproject/motor_cluster_module.qmlproject
- motor_cluster/qmlproject/motor_cluster_rotated.qmlproject
- motor_cluster/qmls/+big/+intro/Logo.qml
- motor_cluster/qmls/+big/Logo.qml
- motor_cluster/qmls/+big/MotorCluster.qml
- motor_cluster/qmls/+big/RangeIconWithText.qml
- motor_cluster/qmls/+big/SpeedoView.qml
- motor_cluster/qmls/+big/Statistics.qml
- motor_cluster/qmls/+big/Warning.qml
- motor_cluster/qmls/+intro/Logo.qml
- motor_cluster/qmls/Background.qml
- motor_cluster/qmls/Blinker.qml
- motor_cluster/qmls/Logo.qml
- motor_cluster/qmls/MainModel.qml
- motor_cluster/qmls/MotorCluster.qml
- motor_cluster/qmls/RangeIconWithText.qml
- motor_cluster/qmls/RoadView.qml
- motor_cluster/qmls/SpeedoView.qml
- motor_cluster/qmls/Statistics.qml
- motor_cluster/qmls/Style.qml
- motor_cluster/qmls/Warning.qml
- motor_cluster/qmls/animation/+intro/+15fps/StartupAnimationConfig.qml
- motor_cluster/qmls/animation/+intro/StartupAnimation.qml
- motor_cluster/qmls/animation/+intro/StartupAnimationConfig.qml
- motor_cluster/qmls/animation/StartupAnimation.qml
- motor_cluster/qmls/bottomElements/+big/BottomCommonElements.qml
- motor_cluster/qmls/bottomElements/+big/OdoTextElement.qml
- motor_cluster/qmls/bottomElements/+big/TextElement.qml
- motor_cluster/qmls/bottomElements/+big/TimeView.qml
- motor_cluster/qmls/bottomElements/BottomCommonElements.qml
- motor_cluster/qmls/bottomElements/OdoTextElement.qml
- motor_cluster/qmls/bottomElements/TextElement.qml
- motor_cluster/qmls/bottomElements/TimeView.qml
- motor_cluster/qmls/gauges/+big/FuelGaugeView.qml
- motor_cluster/qmls/gauges/+big/GearGaugeView.qml
- motor_cluster/qmls/gauges/FuelGaugeView.qml
- motor_cluster/qmls/gauges/GearGaugeView.qml
- motor_cluster/qmls/gauges/StartupConfig.qml
- motor_cluster/qmls/keyboard/+big/InputTextField.qml
- motor_cluster/qmls/keyboard/+big/KeyBase.qml
- motor_cluster/qmls/keyboard/+big/Keyboard.qml
- motor_cluster/qmls/keyboard/+big/KeyboardView.qml
- motor_cluster/qmls/keyboard/InputTextField.qml
- motor_cluster/qmls/keyboard/KeyBase.qml
- motor_cluster/qmls/keyboard/KeyFont20.qml
- motor_cluster/qmls/keyboard/KeyFont36.qml
- motor_cluster/qmls/keyboard/KeyWithImage.qml
- motor_cluster/qmls/keyboard/Keyboard.qml
- motor_cluster/qmls/keyboard/KeyboardView.qml
- motor_cluster/qmls/main/+big/motor_cluster.qml
- motor_cluster/qmls/main/motor_cluster.qml
- motor_cluster/qmls/navigation/+big/Navigation.qml
- motor_cluster/qmls/navigation/Arrow.qml
- motor_cluster/qmls/navigation/Navigation.qml
- motor_cluster/qmls/navigation/NavigationModel.qml
- motor_cluster/qmls/performance/empty/PerformanceMetrics.qml
- motor_cluster/qmls/performance/full/PerformanceMetricItem.qml
- motor_cluster/qmls/performance/full/PerformanceMetrics.qml
- motor_cluster/qmls/tacho/+big/NumberedScaleView.qml
- motor_cluster/qmls/tacho/+big/TachoView.qml
- motor_cluster/qmls/tacho/NumberedScaleView.qml
- motor_cluster/qmls/tacho/TachoView.qml
- motor_cluster/qmls/telltales/+big/TellTalesView.qml
- motor_cluster/qmls/telltales/TellTalesIndicator.qml
- motor_cluster/qmls/telltales/TellTalesModel.qml
- motor_cluster/qmls/telltales/TellTalesView.qml
- motor_cluster/qmls/utils/ClipingItem.qml
- motor_cluster/qmls/utils/ItemWithAcivationAnimations.qml
- motor_cluster/qmls/utils/MathAPI.qml
- motor_cluster/qmls/utils/TextInRoundedBox.qml
- motor_cluster/src/3rdparty/etl/CMakeLists.txt
- motor_cluster/src/mathutils.h
- motor_cluster/src/simulation/drivetrain.cpp
- motor_cluster/src/simulation/drivetrain.h
- motor_cluster/src/simulation/normaldrivestate.cpp
- motor_cluster/src/simulation/normaldrivestate.h
- motor_cluster/src/simulation/simulationcontroller.cpp
- motor_cluster/src/simulation/simulationcontroller.h
- motor_cluster/src/simulation/smfwd.h
- motor_cluster/src/simulation/stateid.h
- motor_cluster/src/simulation/states.cpp
- motor_cluster/src/simulation/states.h
- motor_cluster/src/statemachine.h
- motor_cluster/src/traveo-t2g/main.cpp
Images:
- motor_cluster/images/+big/+intro/qt-logo.png
- motor_cluster/images/+big/qt-logo.png
- motor_cluster/images/+big/range.png
- motor_cluster/images/+big/turn-left.png
- motor_cluster/images/+intro/qt-logo.png
- motor_cluster/images/bg/+big/main-light.png
- motor_cluster/images/bg/+big/main.png
- motor_cluster/images/bg/+big/ref.jpg
- motor_cluster/images/bg/+big/ref_day.png
- motor_cluster/images/bg/main-light.png
- motor_cluster/images/bg/main.png
- motor_cluster/images/bg/ref.jpg
- motor_cluster/images/bg/ref_day.png
- motor_cluster/images/fuelGauge/+big/fuel-colored-bg.png
- motor_cluster/images/fuelGauge/+big/fuel-colored-circle-day.png
- motor_cluster/images/fuelGauge/+big/fuel-colored-circle.png
- motor_cluster/images/fuelGauge/+big/fuel-scale.png
- motor_cluster/images/fuelGauge/+big/hole-in-bg-day.png
- motor_cluster/images/fuelGauge/+big/hole-in-bg.png
- motor_cluster/images/fuelGauge/+big/ring-2.png
- motor_cluster/images/fuelGauge/+big/wave-bottom-part.png
- motor_cluster/images/fuelGauge/+big/wave-shadow.png
- motor_cluster/images/fuelGauge/+big/wave-top-part.png
- motor_cluster/images/fuelGauge/fuel-colored-bg.png
- motor_cluster/images/fuelGauge/fuel-colored-circle-day.png
- motor_cluster/images/fuelGauge/fuel-colored-circle.png
- motor_cluster/images/fuelGauge/fuel-scale.png
- motor_cluster/images/fuelGauge/hole-in-bg-day.png
- motor_cluster/images/fuelGauge/hole-in-bg.png
- motor_cluster/images/fuelGauge/ring-2.png
- motor_cluster/images/fuelGauge/wave-bottom-part.png
- motor_cluster/images/fuelGauge/wave-shadow.png
- motor_cluster/images/fuelGauge/wave-top-part.png
- motor_cluster/images/keyboard/+big/backspace-key.png
- motor_cluster/images/keyboard/+big/enter-key.png
- motor_cluster/images/keyboard/+big/go-home-key.png
- motor_cluster/images/keyboard/+big/go-work-key.png
- motor_cluster/images/keyboard/+big/minimize-keyboard.png
- motor_cluster/images/keyboard/backspace-key.png
- motor_cluster/images/keyboard/enter-key.png
- motor_cluster/images/keyboard/go-home-key.png
- motor_cluster/images/keyboard/go-work-key.png
- motor_cluster/images/keyboard/minimize-keyboard.png
- motor_cluster/images/loading/+big/0001.png
- motor_cluster/images/loading/+big/0002.png
- motor_cluster/images/loading/+big/0003.png
- motor_cluster/images/loading/+big/0004.png
- motor_cluster/images/loading/+big/0005.png
- motor_cluster/images/loading/+big/0006.png
- motor_cluster/images/loading/+big/0007.png
- motor_cluster/images/loading/+big/0008.png
- motor_cluster/images/loading/+big/0009.png
- motor_cluster/images/loading/+big/0010.png
- motor_cluster/images/loading/+big/0011.png
- motor_cluster/images/loading/+big/0012.png
- motor_cluster/images/loading/+big/0013.png
- motor_cluster/images/loading/+big/0014.png
- motor_cluster/images/loading/+big/0015.png
- motor_cluster/images/loading/+big/0016.png
- motor_cluster/images/loading/+big/0017.png
- motor_cluster/images/loading/+big/0018.png
- motor_cluster/images/loading/+big/0019.png
- motor_cluster/images/loading/+big/0020.png
- motor_cluster/images/loading/+big/0021.png
- motor_cluster/images/loading/+big/0022.png
- motor_cluster/images/loading/+big/0023.png
- motor_cluster/images/loading/+big/0024.png
- motor_cluster/images/loading/+big/0025.png
- motor_cluster/images/loading/+big/0026.png
- motor_cluster/images/loading/+big/0027.png
- motor_cluster/images/loading/+big/0028.png
- motor_cluster/images/loading/+big/0029.png
- motor_cluster/images/loading/+big/0030.png
- motor_cluster/images/loading/+big/0031.png
- motor_cluster/images/loading/+big/0032.png
- motor_cluster/images/loading/+big/0033.png
- motor_cluster/images/loading/+big/0034.png
- motor_cluster/images/loading/+big/0035.png
- motor_cluster/images/loading/+big/0036.png
- motor_cluster/images/loading/+big/0037.png
- motor_cluster/images/loading/+big/0038.png
- motor_cluster/images/loading/+big/0039.png
- motor_cluster/images/loading/+big/0040.png
- motor_cluster/images/loading/+big/0041.png
- motor_cluster/images/loading/+big/0042.png
- motor_cluster/images/loading/+big/0043.png
- motor_cluster/images/loading/+big/0044.png
- motor_cluster/images/loading/+big/0045.png
- motor_cluster/images/loading/+big/0046.png
- motor_cluster/images/loading/+big/0047.png
- motor_cluster/images/loading/+big/0048.png
- motor_cluster/images/loading/+big/0049.png
- motor_cluster/images/loading/+big/0050.png
- motor_cluster/images/loading/+big/0051.png
- motor_cluster/images/loading/+big/0052.png
- motor_cluster/images/loading/+big/0053.png
- motor_cluster/images/loading/+big/0054.png
- motor_cluster/images/loading/+big/0055.png
- motor_cluster/images/loading/+big/0056.png
- motor_cluster/images/loading/+big/0057.png
- motor_cluster/images/loading/+big/0058.png
- motor_cluster/images/loading/+big/0059.png
- motor_cluster/images/loading/+big/0060.png
- motor_cluster/images/loading/+big/0061.png
- motor_cluster/images/loading/+big/0062.png
- motor_cluster/images/loading/+big/0063.png
- motor_cluster/images/loading/+big/0064.png
- motor_cluster/images/loading/+big/0065.png
- motor_cluster/images/loading/+big/0066.png
- motor_cluster/images/loading/+big/0067.png
- motor_cluster/images/loading/+big/0068.png
- motor_cluster/images/loading/+big/0069.png
- motor_cluster/images/loading/+big/0070.png
- motor_cluster/images/loading/+big/0071.png
- motor_cluster/images/loading/+big/0072.png
- motor_cluster/images/loading/+big/0073.png
- motor_cluster/images/loading/+big/0074.png
- motor_cluster/images/loading/+big/0075.png
- motor_cluster/images/loading/+big/0076.png
- motor_cluster/images/loading/+big/0077.png
- motor_cluster/images/loading/+big/0078.png
- motor_cluster/images/loading/+big/0079.png
- motor_cluster/images/loading/+big/0080.png
- motor_cluster/images/loading/+big/0081.png
- motor_cluster/images/loading/+big/0082.png
- motor_cluster/images/loading/+big/0083.png
- motor_cluster/images/loading/+big/0084.png
- motor_cluster/images/loading/+big/0085.png
- motor_cluster/images/loading/+big/0086.png
- motor_cluster/images/loading/+big/0087.png
- motor_cluster/images/loading/+big/0088.png
- motor_cluster/images/loading/+big/0089.png
- motor_cluster/images/loading/0001.png
- motor_cluster/images/loading/0002.png
- motor_cluster/images/loading/0003.png
- motor_cluster/images/loading/0004.png
- motor_cluster/images/loading/0005.png
- motor_cluster/images/loading/0006.png
- motor_cluster/images/loading/0007.png
- motor_cluster/images/loading/0008.png
- motor_cluster/images/loading/0009.png
- motor_cluster/images/loading/0010.png
- motor_cluster/images/loading/0011.png
- motor_cluster/images/loading/0012.png
- motor_cluster/images/loading/0013.png
- motor_cluster/images/loading/0014.png
- motor_cluster/images/loading/0015.png
- motor_cluster/images/loading/0016.png
- motor_cluster/images/loading/0017.png
- motor_cluster/images/loading/0018.png
- motor_cluster/images/loading/0019.png
- motor_cluster/images/loading/0020.png
- motor_cluster/images/loading/0021.png
- motor_cluster/images/loading/0022.png
- motor_cluster/images/loading/0023.png
- motor_cluster/images/loading/0024.png
- motor_cluster/images/loading/0025.png
- motor_cluster/images/loading/0026.png
- motor_cluster/images/loading/0027.png
- motor_cluster/images/loading/0028.png
- motor_cluster/images/loading/0029.png
- motor_cluster/images/loading/0030.png
- motor_cluster/images/loading/0031.png
- motor_cluster/images/loading/0032.png
- motor_cluster/images/loading/0033.png
- motor_cluster/images/loading/0034.png
- motor_cluster/images/loading/0035.png
- motor_cluster/images/loading/0036.png
- motor_cluster/images/loading/0037.png
- motor_cluster/images/loading/0038.png
- motor_cluster/images/loading/0039.png
- motor_cluster/images/loading/0040.png
- motor_cluster/images/loading/0041.png
- motor_cluster/images/loading/0042.png
- motor_cluster/images/loading/0043.png
- motor_cluster/images/loading/0044.png
- motor_cluster/images/loading/0045.png
- motor_cluster/images/loading/0046.png
- motor_cluster/images/loading/0047.png
- motor_cluster/images/loading/0048.png
- motor_cluster/images/loading/0049.png
- motor_cluster/images/loading/0050.png
- motor_cluster/images/loading/0051.png
- motor_cluster/images/loading/0052.png
- motor_cluster/images/loading/0053.png
- motor_cluster/images/loading/0054.png
- motor_cluster/images/loading/0055.png
- motor_cluster/images/loading/0056.png
- motor_cluster/images/loading/0057.png
- motor_cluster/images/loading/0058.png
- motor_cluster/images/loading/0059.png
- motor_cluster/images/loading/0060.png
- motor_cluster/images/loading/0061.png
- motor_cluster/images/loading/0062.png
- motor_cluster/images/loading/0063.png
- motor_cluster/images/loading/0064.png
- motor_cluster/images/loading/0065.png
- motor_cluster/images/loading/0066.png
- motor_cluster/images/loading/0067.png
- motor_cluster/images/loading/0068.png
- motor_cluster/images/loading/0069.png
- motor_cluster/images/loading/0070.png
- motor_cluster/images/loading/0071.png
- motor_cluster/images/loading/0072.png
- motor_cluster/images/loading/0073.png
- motor_cluster/images/loading/0074.png
- motor_cluster/images/loading/0075.png
- motor_cluster/images/loading/0076.png
- motor_cluster/images/loading/0077.png
- motor_cluster/images/loading/0078.png
- motor_cluster/images/loading/0079.png
- motor_cluster/images/loading/0080.png
- motor_cluster/images/loading/0081.png
- motor_cluster/images/loading/0082.png
- motor_cluster/images/loading/0083.png
- motor_cluster/images/loading/0084.png
- motor_cluster/images/loading/0085.png
- motor_cluster/images/loading/0086.png
- motor_cluster/images/loading/0087.png
- motor_cluster/images/loading/0088.png
- motor_cluster/images/loading/0089.png
- motor_cluster/images/mainScreen/+big/left-lines-day.png
- motor_cluster/images/mainScreen/+big/left-lines.png
- motor_cluster/images/mainScreen/+big/right-lines-day.png
- motor_cluster/images/mainScreen/+big/right-lines.png
- motor_cluster/images/mainScreen/+big/road-day.png
- motor_cluster/images/mainScreen/+big/road.png
- motor_cluster/images/mainScreen/+big/tacho-bottom-line-day.png
- motor_cluster/images/mainScreen/+big/tacho-bottom-line.png
- motor_cluster/images/mainScreen/+big/tacho-top-line-day.png
- motor_cluster/images/mainScreen/+big/tacho-top-line.png
- motor_cluster/images/mainScreen/left-lines-day.png
- motor_cluster/images/mainScreen/left-lines.png
- motor_cluster/images/mainScreen/right-lines-day.png
- motor_cluster/images/mainScreen/right-lines.png
- motor_cluster/images/mainScreen/road-day.png
- motor_cluster/images/mainScreen/road.png
- motor_cluster/images/mainScreen/tacho-bottom-line-day.png
- motor_cluster/images/mainScreen/tacho-bottom-line.png
- motor_cluster/images/mainScreen/tacho-top-line-day.png
- motor_cluster/images/mainScreen/tacho-top-line.png
- motor_cluster/images/navigation/+big/destination-pin.png
- motor_cluster/images/navigation/+big/tbt-1-arrow-left.png
- motor_cluster/images/navigation/+big/tbt-1-arrow-stright.png
- motor_cluster/images/navigation/+big/tbt-center-separator.png
- motor_cluster/images/navigation/destination-pin.png
- motor_cluster/images/navigation/tbt-1-arrow-left.png
- motor_cluster/images/navigation/tbt-1-arrow-stright.png
- motor_cluster/images/navigation/tbt-center-separator.png
- motor_cluster/images/qt-logo.png
- motor_cluster/images/range.png
- motor_cluster/images/status/+big/battery-status.png
- motor_cluster/images/status/+big/distance-status.png
- motor_cluster/images/status/+big/engine-oil-status.png
- motor_cluster/images/status/+big/fuel-avg-status.png
- motor_cluster/images/status/+big/service-status.png
- motor_cluster/images/status/+big/time-status.png
- motor_cluster/images/status/battery-status.png
- motor_cluster/images/status/distance-status.png
- motor_cluster/images/status/engine-oil-status.png
- motor_cluster/images/status/fuel-avg-status.png
- motor_cluster/images/status/service-status.png
- motor_cluster/images/status/time-status.png
- motor_cluster/images/tacho/+big/1.png
- motor_cluster/images/tacho/+big/2.png
- motor_cluster/images/tacho/+big/3.png
- motor_cluster/images/tacho/+big/4.png
- motor_cluster/images/tacho/+big/5.png
- motor_cluster/images/tacho/+big/6.png
- motor_cluster/images/tacho/1.png
- motor_cluster/images/tacho/2.png
- motor_cluster/images/tacho/3.png
- motor_cluster/images/tacho/4.png
- motor_cluster/images/tacho/5.png
- motor_cluster/images/tacho/6.png
- motor_cluster/images/tacho/light/+big/01.png
- motor_cluster/images/tacho/light/+big/02.png
- motor_cluster/images/tacho/light/+big/03.png
- motor_cluster/images/tacho/light/+big/04.png
- motor_cluster/images/tacho/light/+big/05.png
- motor_cluster/images/tacho/light/+big/06.png
- motor_cluster/images/tacho/light/01.png
- motor_cluster/images/tacho/light/02.png
- motor_cluster/images/tacho/light/03.png
- motor_cluster/images/tacho/light/04.png
- motor_cluster/images/tacho/light/05.png
- motor_cluster/images/tacho/light/06.png
- motor_cluster/images/telltales/+big/battery.png
- motor_cluster/images/telltales/+big/engine-failure.png
- motor_cluster/images/telltales/+big/engine-oil.png
- motor_cluster/images/telltales/+big/fuel.png
- motor_cluster/images/telltales/+big/high-beams.png
- motor_cluster/images/telltales/battery.png
- motor_cluster/images/telltales/engine-failure.png
- motor_cluster/images/telltales/engine-oil.png
- motor_cluster/images/telltales/fuel.png
- motor_cluster/images/telltales/high-beams.png
- motor_cluster/images/turn-left.png
- motor_cluster/images/warnings/+big/battery-warning.png
- motor_cluster/images/warnings/+big/engine-failure-warning.png
- motor_cluster/images/warnings/+big/engine-oil-warning.png
- motor_cluster/images/warnings/battery-warning.png
- motor_cluster/images/warnings/engine-failure-warning.png
- motor_cluster/images/warnings/engine-oil-warning.png
Available under certain Qt licenses.
Find out more.