On this page

RegExpFilter QML Type

Filters data in a SortFilterProxyModel by matching a role value against a regular expression. More...

Import Statement: import QtQml.Models
Since: Qt 6.12
Inherits:

RoleFilter

Status: Technology preview

This type is in technology preview and is subject to change.

Properties

Detailed Description

RegExpFilter allows filtering model data using regular expression matching on a specified role.

A JavaScript regular expression literal can be assigned directly to regExp:

SortFilterProxyModel {
    sourceModel: processModel
    filters: RegExpFilter {
        roleName: "userId"
        regExp: /root/i
    }
}

Property Documentation

regExp : regexp

This property holds the regular expression used to filter the data. A JavaScript regular expression literal can be assigned directly.

When the regExp has an empty pattern, the filter is inactive and all rows pass through.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.