QAndroidMatchPattern Class

Used to store a path and pattern matcher for use in QAndroidIntentFilter. (Technical Preview). More...

Header: #include <QAndroidMatchPattern>
CMake: find_package(Qt6 REQUIRED COMPONENTS AndroidAutomotiveBase)
target_link_libraries(mytarget PRIVATE Qt6::AndroidAutomotiveBase)
Since: QtAndroidAutomotive 6.5
In QML: AndroidMatchPattern and matchPattern

Public Types



Public Functions

QAndroidMatchPattern(const QString &pattern, QAndroidMatchPattern::MatchType matchType)
QAndroidMatchPattern(const QAndroidMatchPattern &other)
QAndroidMatchPattern(QAndroidMatchPattern &&other)
QAndroidMatchPattern::MatchType matchType() const
QString pattern() const
void setMatchType(QAndroidMatchPattern::MatchType matchType)
void setPattern(const QString &pattern)
void swap(QAndroidMatchPattern &other)
QAndroidMatchPattern &operator=(const QAndroidMatchPattern &other)

Detailed Description

This type is a close representation of the Android PatternMatcher.

Like the Android PatternMatcher, it is safe to use on untrusted data as it does not provide full support for regular expressions but only simple globbing.

Member Type Documentation

enum class QAndroidMatchPattern::MatchType

This enum type specifies the type of matching done by this QAndroidMatchPattern.

QAndroidMatchPattern::MatchType::PATTERN_LITERAL0The pattern must exactly match the string it is tested against.
QAndroidMatchPattern::MatchType::PATTERN_PREFIX1The pattern must match the beginning of the string it is tested against.
QAndroidMatchPattern::MatchType::PATTERN_SIMPLE_GLOB2The pattern is interpreted with a simple glob syntax for matching against the string it is tested against.
QAndroidMatchPattern::MatchType::PATTERN_ADVANCED_GLOB3The pattern is interpreted with a regular expression-like syntax for matching against the string it is tested against.
QAndroidMatchPattern::MatchType::PATTERN_SUFFIX4The pattern must match the end of the string it is tested against

Property Documentation

matchType : MatchType

Holds the current matcher type.

Access functions:

QAndroidMatchPattern::MatchType matchType() const
void setMatchType(QAndroidMatchPattern::MatchType matchType)

pattern : QString

Holds the current pattern.

Access functions:

QString pattern() const
void setPattern(const QString &pattern)

Member Function Documentation


Constructs an empty QAndroidMatchPattern.

[explicit] QAndroidMatchPattern::QAndroidMatchPattern(const QString &pattern, QAndroidMatchPattern::MatchType matchType)

Constructs a QAndroidMatchPattern with pattern and matcher type matchType.

QAndroidMatchPattern::QAndroidMatchPattern(const QAndroidMatchPattern &other)

Copy-constructs a QAndroidMatchPattern instance from other.

QAndroidMatchPattern::QAndroidMatchPattern(QAndroidMatchPattern &&other)

Constructs a new QAndroidMatchPattern instance via a move operation from other.

void QAndroidMatchPattern::setMatchType(QAndroidMatchPattern::MatchType matchType)

Sets the matcher type to be matchType.

Note: Setter function for property matchType.

See also matchType().

void QAndroidMatchPattern::setPattern(const QString &pattern)

Sets the pattern to be pattern.

Note: Setter function for property pattern.

See also pattern().

void QAndroidMatchPattern::swap(QAndroidMatchPattern &other)

Swaps this QAndroidMatchPattern instance with other.

QAndroidMatchPattern &QAndroidMatchPattern::operator=(const QAndroidMatchPattern &other)

Assigns the value of the QAndroidMatchPattern other to this instance.

Available under certain Qt licenses.
Find out more.