On this page

C

Qt for Android Automotive Vehicle module

This module contains classes and templates to access vehicle-specific functionality. The essence of this module is not only to give access to vehicle functions covered by Android Automotive OS but also to help you in creating integration to your own custom vehicle functionality. All this is done by using templates and automated code generation besides conventional code to keep the cost of adding new features and maintenance down.

Module parts

The following libraries are in this module:

  • Vehicle Library contains C++ API for accessing vehicle functionality.
  • Vehicle Quick Library contains QML types for accessing vehicle functionality.
  • Vehicle Properties Code Generation provides Jinja2 templates and Java infrastructure for generating C++ and Java integration code from customer-defined interface descriptions. Customers supply their own .qface and .yaml files mapping vehicle properties to the Android VHAL IDs of their target Android version, and call qt_ifcodegen_extend_target() in their own project — see Qt IF Android Vehicle Properties for the full workflow.
  • Vehicle Properties Front End (deprecated since Qt 6.12) — a pre-built set of generated libraries covering a broad set of Android VHAL properties. Deprecated in favour of the customer-defined codegen approach above; will be removed in Qt 7.

Using the module

Using a Qt library requires linking against the module library, either directly or through other dependencies. The CMake build tool is supported.

To include the non-generated definitions of the Vehicle library's classes, use the following directive for C++:

#include <QtAndroidAutomotiveVehicle>

To use the non-generated QML types from this library, add the following import statement to your .qml file:

import QtAndroidAutomotive.Vehicle

Building with CMake

Use the find_package() and target_link_libraries() commands to locate and link the needed module component from the Qt6 package:

find_package(Qt6 REQUIRED COMPONENTS AndroidAutomotiveVehicle)
target_link_libraries(mytarget PRIVATE Qt::AndroidAutomotiveVehicle)

Also look at Qt IF Android Vehicle Properties to see the use of the supplied generated code.

Permissions

Some of the APIs in the module need Android permissions to function properly. For more details, see Permissions in the Qt for Android Automotive Vehicle module.

API reference

Links to the API reference materials:

Examples

HVAC Control

Demonstrates usage of the Qt IF Generator Extensions for Android Automotive.

Zoned HVAC Control

Demonstrates how to handle zoned features when using the Qt IF Generator Extensions for Android Automotive.

Available under certain Qt licenses.
Find out more.