ValueFilter QML Type
SortFilterProxyModel 内のデータを、ロール名と値に基づいてフィルタリングします。詳細...
| Import Statement: | import QtQml.Models |
| Since: | Qt 6.10 |
| Inherits: | |
| Status: | Technology preview |
このタイプはテクノロジープレビュー段階にあり、変更される可能性があります。
プロパティ
- value : variant
詳細説明
ValueFilter を使用すると、ソースモデルで設定されたロール名、指定された値、またはその両方に基づいてデータをフィルタリングできます。データのフィルタリングに使用されるロール名は、モデルrole name に基づいている必要があります。ロール名のデフォルト値は"display" です。
以下のスニペットは、ValueFilter を使用して、ロール名"favorite" の値が"true" であるソースモデルのデータのみを含める方法を示しています:
SortFilterProxyModel {
sourceModel: model
filters: [
ValueFilter {
roleName: "favorite"
value: true
}
]
}プロパティのドキュメント
value : variant
このプロパティには、データのフィルタリングに使用できる特定の値が格納されています。
© 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.