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 and intro variant)
  • Infineon TRAVEO T2G (small variant)

Screenshots

Start-up animation

Night Mode

Day Mode

Keyboard

Files:

Images:

Available under certain Qt licenses.
Find out more.