RegExpRole QML Type

A ProxyRole extracting data from a source role via a regular expression. More...

Import Statement: import SortFilterProxyModel .
Inherits:

ProxyRole

Properties

Detailed Description

A RegExpRole is a ProxyRole that provides a role for each named capture group of its regular expression pattern.

In the following example, the date role of the source model will be extracted in 3 roles in the proxy moodel: year, month and day.

SortFilterProxyModel {
    sourceModel: eventModel
    proxyRoles: RegExpRole {
        roleName: "date"
        pattern: "(?<year>\\d{4})-(?<month>\\d{2})-(?<day>\\d{2})"
    }
}

Property Documentation

caseSensitivity : Qt::CaseSensitivity

This property holds the caseSensitivity of the regular expression.


pattern : QString

This property holds the pattern of the regular expression of this RegExpRole. The RegExpRole will expose a role for each of the named capture group of the pattern.


roleName : QString

This property holds the role name that the RegExpRole is using to query the source model's data to extract new roles from.