C

QAndroidIntentFilter Class

Used for filtering intents in combination with QAndroidBroadcastReceiver. (Technical Preview). More...

Header: #include <QAndroidIntentFilter>
CMake: find_package(Qt6 REQUIRED COMPONENTS AndroidAutomotiveBase)
target_link_libraries(mytarget PRIVATE Qt6::AndroidAutomotiveBase)
Since: QtAndroidAutomotive 6.5
Inherits: QObject

Public Functions

QAndroidIntentFilter(QObject *parent = nullptr)
QAndroidIntentFilter(const QString &action, QObject *parent = nullptr)
QAndroidIntentFilter(const QString &action, const QString &dataType, QObject *parent = nullptr)
QString action(int index) const
int actionsCount() const
int categoriesCount() const
QString category(int index) const
int dataAuthoritiesCount() const
QAndroidAuthorityEntry dataAuthority(int index) const
QAndroidMatchPattern dataPath(int index) const
int dataPathsCount() const
QString dataScheme(int index) const
QAndroidMatchPattern dataSchemeSpecificPart(int index) const
int dataSchemeSpecificPartsCount() const
int dataSchemesCount() const
QString dataType(int index) const
int dataTypesCount() const
QJniObject handle()

Public Slots

void addAction(const QString &action)
void addCategory(const QString &category)
void addDataAuthority(const QAndroidAuthorityEntry &authorityEntry)
void addDataAuthority(const QString &host, const QString &port)
void addDataPath(const QAndroidMatchPattern &matchPattern)
void addDataPath(const QString &path, QAndroidMatchPattern::MatchType type)
void addDataScheme(const QString &scheme)
void addDataSchemeSpecificPart(const QAndroidMatchPattern &matchPattern)
void addDataSchemeSpecificPart(const QString &schemeSpecificPart, QAndroidMatchPattern::MatchType type)
void addDataType(const QString &type)
void clearActions()
void clearCategories()
void clearDataAuthorities()
void clearDataPaths()
void clearDataSchemeSpecificParts()
void clearDataSchemes()
void clearDataTypes()
void removeAction(int index)
void removeCategory(int index)
void removeDataAuthority(int index)
void removeDataPath(int index)
void removeDataScheme(int index)
void removeDataSchemeSpecificPart(int index)
void removeDataType(int index)

Detailed Description

This type closely mirrors the Android IntentFilter and is used in a similar way to filter intents received by QAndroidBroadcastReceiver.

This class is a thin wrapper around an Android IntentFilter. It can be used directly to interact with the underlying object, or the user may access the object manually via handle().

Member Function Documentation

[explicit] QAndroidIntentFilter::QAndroidIntentFilter(QObject *parent = nullptr)

Constructs a QAndroidIntentFilter with the given parent.

[explicit] QAndroidIntentFilter::QAndroidIntentFilter(const QString &action, QObject *parent = nullptr)

Constructs a QAndroidIntentFilter with the given parent and creates a new intent filter with the given action.

[explicit] QAndroidIntentFilter::QAndroidIntentFilter(const QString &action, const QString &dataType, QObject *parent = nullptr)

Constructs a QAndroidIntentFilter with the given parent which will use the given action and dataType to filter intents.

QString QAndroidIntentFilter::action(int index) const

Returns the action denoted by index in the filter.

int QAndroidIntentFilter::actionsCount() const

Returns the number of actions in the filter.

[slot] void QAndroidIntentFilter::addAction(const QString &action)

Adds an action action to the filter.

[slot] void QAndroidIntentFilter::addCategory(const QString &category)

Adds a category category to the filter.

[slot] void QAndroidIntentFilter::addDataAuthority(const QAndroidAuthorityEntry &authorityEntry)

Adds data authority authorityEntry to the filter.

[slot] void QAndroidIntentFilter::addDataAuthority(const QString &host, const QString &port)

Adds a data authority with given host and port to the filter.

[slot] void QAndroidIntentFilter::addDataPath(const QAndroidMatchPattern &matchPattern)

Adds data path represented by matchPattern to the filter.

[slot] void QAndroidIntentFilter::addDataPath(const QString &path, QAndroidMatchPattern::MatchType type)

Adds data path path to the filter with a pattern matcher type type.

Note: The path part of a URI starts with a '/'. This should be taken into account when the QAndroidMatchPattern::MatchType is PATTERN_LITERAL or PATTERN_PREFIX because of the leading '/'. See Android app manifest dataPath documentation.

[slot] void QAndroidIntentFilter::addDataScheme(const QString &scheme)

Adds data scheme scheme to the filter.

[slot] void QAndroidIntentFilter::addDataSchemeSpecificPart(const QAndroidMatchPattern &matchPattern)

Adds a new intent data scheme specific part to the filter using matchPattern.

QAndroidMatchPattern::pattern() and QAndroidMatchPattern::matchType() will be used to construct a new data scheme specific part.

[slot] void QAndroidIntentFilter::addDataSchemeSpecificPart(const QString &schemeSpecificPart, QAndroidMatchPattern::MatchType type)

Adds a new intent data scheme specific part schemeSpecificPart to the filter with a pattern matching type of type.

[slot] void QAndroidIntentFilter::addDataType(const QString &type)

Adds data type type to the filter.

int QAndroidIntentFilter::categoriesCount() const

Returns the number of categories in the filter.

QString QAndroidIntentFilter::category(int index) const

Returns the category denoted by index in the filter.

[slot] void QAndroidIntentFilter::clearActions()

Removes all actions in the filter.

[slot] void QAndroidIntentFilter::clearCategories()

Removes all categories in the filter.

[slot] void QAndroidIntentFilter::clearDataAuthorities()

Removes all data authorities in the filter.

[slot] void QAndroidIntentFilter::clearDataPaths()

Removes all data paths in the filter.

[slot] void QAndroidIntentFilter::clearDataSchemeSpecificParts()

Removes all data scheme specific parts in the filter.

[slot] void QAndroidIntentFilter::clearDataSchemes()

Removes all data schemes in the filter.

[slot] void QAndroidIntentFilter::clearDataTypes()

Removes all data types in the filter.

int QAndroidIntentFilter::dataAuthoritiesCount() const

Returns the number of data authorities in the filter.

QAndroidAuthorityEntry QAndroidIntentFilter::dataAuthority(int index) const

Returns the data authority denoted by index in the filter.

QAndroidMatchPattern QAndroidIntentFilter::dataPath(int index) const

Returns the data path denoted by index in the filter.

int QAndroidIntentFilter::dataPathsCount() const

Returns the number of data paths in the filter.

QString QAndroidIntentFilter::dataScheme(int index) const

Returns the data scheme denoted by index in the filter.

QAndroidMatchPattern QAndroidIntentFilter::dataSchemeSpecificPart(int index) const

Returns the data scheme specific part denoted by index in the filter.

int QAndroidIntentFilter::dataSchemeSpecificPartsCount() const

Returns the number of data scheme specific parts in the filter.

int QAndroidIntentFilter::dataSchemesCount() const

Returns the number of data schemes in the filter.

QString QAndroidIntentFilter::dataType(int index) const

Returns the data type denoted by index in the filter.

int QAndroidIntentFilter::dataTypesCount() const

Returns the number of data types in the filter.

QJniObject QAndroidIntentFilter::handle()

Returns the QJniObject representation of the {Android IntentFilter}{Android Intent Filter} used by this QAndroidIntentFilter.

[slot] void QAndroidIntentFilter::removeAction(int index)

Removes the action denoted by index in the filter.

[slot] void QAndroidIntentFilter::removeCategory(int index)

Removes the action denoted by index in the filter.

[slot] void QAndroidIntentFilter::removeDataAuthority(int index)

Removes the data authority denoted by index in the filter.

[slot] void QAndroidIntentFilter::removeDataPath(int index)

Removes the data path denoted by index in the filter.

[slot] void QAndroidIntentFilter::removeDataScheme(int index)

Removes the data scheme denoted by index in the filter.

[slot] void QAndroidIntentFilter::removeDataSchemeSpecificPart(int index)

Removes the data scheme specific part denoted by index in the filter.

[slot] void QAndroidIntentFilter::removeDataType(int index)

Removes the data type denoted by index in the filter.

Available under certain Qt licenses.
Find out more.