ValueFilter QML Type

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

import 語句: import QtQml.Models
Since: Qt 6.10
繼承:

RoleFilter

狀態: 預備

This type is under development and is subject to change.

特性

詳細描述

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
        }
    ]
}
					

特性文檔編製

value : variant

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