C

Qt Driver State

This module provides a C++ and a QML wrapper for handling changes in state of Car User Experience (UX) Restrictions rules.

Using the Module

Using a Qt module requires linking against the module library, either directly or through other dependencies. Additionally, the activity needs to be distraction optimized by adding the following metadata to the <activity> element in the AndroidManifest.xml file for the application:

<activity android:name=(....)>
(...)
<meta-data android:name="distractionOptimized" android:value="true"/>
</activity>

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 AndroidDriverState)
target_link_libraries(mytarget PUBLIC Qt6::AndroidDriverState)

C++ API

To include the definitions of the module's classes, use the following directive for C++:

#include <QtAndroidDriverState>

QML API

To use the QML types in Qt Driver State, add the following import statement to your .qml file:

import QtAndroidAutomotive.AndroidDriverState

API Reference

Examples

Available under certain Qt licenses.
Find out more.