ValueFilter QML Type

SortFilterProxyModel のデータをロール名と値に基づいてフィルタリングします。詳細...

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

RoleFilter

Status: Preliminary

この型は開発中であり、変更される可能性があります。

プロパティ

詳細説明

ValueFilter は、ソースモデルで設定されたロール名または指定された値、あるいはその両方に従って、ユーザがデータをフィルタリングできるようにします。データのフィルタリングに使用されるロール名は、モデルrole name に基づかなければならない。ロール名の既定値は"display" です。

以下のスニペットは、ValueFilter を使用して、ロール名"favorite" の値が"true" であるソース・モデルからのデータのみを含める方法を示しています:

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

プロパティのドキュメント

value : 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.