- Qt 6.10
- QML Types
- QtQml.Models
- ValueFilter
- Qt 6.10.2 Reference Documentation

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

- List of all members, including inherited members

## Properties

- value : variant

## 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 : variant

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