ValueFilter QML Type

Filters data in a SortFilterProxyModel based on role name and value. More...

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

RoleFilter

Status: Preliminary

This type is under development and is subject to change.

Properties

Detailed Description

ValueFilter allows the user to filter the data according to the role name or specified value or both as configured in the source model. The role name used to filter the data shall be based on model role name. The default value for role name is "display".

The following snippet shows how ValueFilter can be used to only include data from the source model where the value of the role name "favorite" is "true":

SortFilterProxyModel {
    model: sourceModel
    filters: [
        ValueFilter {
            roleName: "favorite"
            value: true
        }
    ]
}

Property Documentation

value : string

This property holds specific value that can be used to filter the data.

The default value is empty string.


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