On this page

AnyOfFilter QML Type

Combines multiple filters using logical OR in a SortFilterProxyModel. More...

Import Statement: import QtQml.Models
Since: Qt 6.12
Status: Technology preview

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

Properties

Detailed Description

AnyOfFilter groups a set of child filters and finds a matching row or column for least one of child filter in the group. This is useful when you have many independent conditions to include a row, without requiring all conditions to be satisfied.

The following snippet shows how AnyOfFilter can be used to include rows where status is either "active" or "pending":

SortFilterProxyModel {
    sourceModel: model
    filters: [
        AnyOfFilter {
            ValueFilter {
                roleName: "status"
                value: "active"
            }
            ValueFilter {
                roleName: "status"
                value: "pending"
            }
        }
    ]
}

Property Documentation

filters : list<Filter>

The list of child filters evaluated with logical OR. A row is accepted if at least one filter in this list accepts it.

This is the default property, so filters can be declared as direct children without the filters keyword:

AnyOfFilter {
    ValueFilter { roleName: "status"; value: "active" }
    ValueFilter { roleName: "status"; value: "pending" }
}

© 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.