C

QDriverDistraction Class

Helper class that enables following user expereince (UX) restriction state changes. More...

Header: #include <QDriverDistraction>
CMake: find_package(Qt6 REQUIRED COMPONENTS AndroidDriverState)
target_link_libraries(mytarget PRIVATE Qt6::AndroidDriverState)
qmake: QT += androiddriverstate
Since: Qt 6.4
Instantiated By: DriverDistraction
Inherits: QObject

Public Types

enum QRestriction { Baseline, NoDialpad, NoFiltering, LimitStringLength, NoKeyboard, …, NoVoiceTranscription }
flags QRestrictions

Properties

Public Functions

QDriverDistraction::QRestrictions currentRestrictions() const
int maxContentDepth() const
int maxCumulativeContentItems() const
int maxRestrictedStringLength() const

Signals

void maxContentDepthChanged(int maxContentDepth)
void maxCumulativeContentItemsChanged(int maxCumulativeContentItems)
void maxRestrictedStringLengthChanged(int maxRestrictedStringLength)
void restrictionsChanged(QDriverDistraction::QRestrictions restrictions)

Static Public Members

QDriverDistraction *instance()

Detailed Description

Android Automotive's Driver Distraction feature is described in Driver Distraction Guidelines.

Member Type Documentation

enum QDriverDistraction::QRestriction
flags QDriverDistraction::QRestrictions

Flags for determining which Car UX Restrictions are active.

ConstantValueDescription
QDriverDistraction::Baseline0No specific restrictions in place.
QDriverDistraction::NoDialpad1 << 0No dialpad for the purpose of initiating a phone call.
QDriverDistraction::NoFiltering1 << 1No filtering a list with alpha-numeric character via the use of a character entry method.
QDriverDistraction::LimitStringLength1 << 2Strings length cannot exceed the character limit.
QDriverDistraction::NoKeyboard1 << 3No text entry for the purpose of searching or other manual text string entry activities.
QDriverDistraction::NoVideo1 << 4No video.
QDriverDistraction::LimitContent1 << 5Limit the number of items a user can browse through in total, in a single task.
QDriverDistraction::NoSetup1 << 6No setup that requires form entry or interaction with external devices.
QDriverDistraction::NoTextMessage1 << 7No Text Message.
QDriverDistraction::NoVoiceTranscription1 << 8No text transcription (live or leave behind) of voice can be shown.

The QRestrictions type is a typedef for QFlags<QRestriction>. It stores an OR combination of QRestriction values.

Property Documentation

[read-only] currentRestrictions : const QRestrictions

This property holds the current Car UX Restrictions state.

Access functions:

QDriverDistraction::QRestrictions currentRestrictions() const

Notifier signal:

void restrictionsChanged(QDriverDistraction::QRestrictions restrictions)

[read-only] maxContentDepth : const int

This property holds the current maximum content depth.

Access functions:

int maxContentDepth() const

Notifier signal:

void maxContentDepthChanged(int maxContentDepth)

[read-only] maxCumulativeContentItems : const int

This property holds the current maximum cumulative content items.

Access functions:

Notifier signal:

void maxCumulativeContentItemsChanged(int maxCumulativeContentItems)

[read-only] maxRestrictedStringLength : const int

This property holds the current maximum restricted string length.

Access functions:

Notifier signal:

void maxRestrictedStringLengthChanged(int maxRestrictedStringLength)

Member Function Documentation

QDriverDistraction::QRestrictions QDriverDistraction::currentRestrictions() const

Returns the current Car UX Restrictions state.

Note: Getter function for property currentRestrictions.

[static] QDriverDistraction *QDriverDistraction::instance()

Returns a pointer to the QDriverDistraction instance.

int QDriverDistraction::maxContentDepth() const

Returns the current maximum content depth.

Note: Getter function for property maxContentDepth.

[signal] void QDriverDistraction::maxContentDepthChanged(int maxContentDepth)

This signal is emitted when the maximum allowable number of content depth levels or view traversals through any one path in a single task changed. The maxContentDepth indicates the new maximum number of content depth.

Note: Notifier signal for property maxContentDepth.

int QDriverDistraction::maxCumulativeContentItems() const

Returns the current maximum cumulative content items.

Note: Getter function for property maxCumulativeContentItems.

[signal] void QDriverDistraction::maxCumulativeContentItemsChanged(int maxCumulativeContentItems)

This signal is emitted when the maximum allowable number of content items that can be displayed to a user during traversal through any one path in a single task changed. The maxCumulativeContentItems indicates the new maximum number of content items changed.

Note: Notifier signal for property maxCumulativeContentItems.

int QDriverDistraction::maxRestrictedStringLength() const

Returns the current maximum restricted string length.

Note: Getter function for property maxRestrictedStringLength.

[signal] void QDriverDistraction::maxRestrictedStringLengthChanged(int maxRestrictedStringLength)

This signal is emitted when the the maximum length of general purpose strings that can be displayed, levels or view traversals through any one path in a single task, has changed. The maxRestrictedStringLength indicates the new maximum string length.

Note: Notifier signal for property maxRestrictedStringLength.

[signal] void QDriverDistraction::restrictionsChanged(QDriverDistraction::QRestrictions restrictions)

This signal is emitted when Car UX Restrictions that are active have changed. The restrictions parameter indicates the new combination of active Car UX Restrictions.

Note: Notifier signal for property currentRestrictions.

Available under certain Qt licenses.
Find out more.