RangeFilter QML Type
SortFilterProxyModel 内のデータを、ロールの値が指定された範囲内にあるかどうかを検証してフィルタリングします。詳細...
| Import Statement: | import QtQml.Models |
| Since: | Qt 6.12 |
| Inherits: | |
| Status: | Technology preview |
このタイプはテクノロジープレビュー段階にあり、変更される可能性があります。
プロパティ
方法
- variant exclusive(value)
詳細な説明
RangeFilter は、設定されたロールの値がminimum からmaximum の範囲内にある行を受け入れます。デフォルトでは、両端の値は範囲に含まれます。
次の例は、CPU 使用率が 70 から 100 の範囲にあるプロセスを示しています:
SortFilterProxyModel {
sourceModel: processModel
filters: [
RangeFilter {
roleName: "cpuUsage"
minimum: 70
maximum: 100
}
]
}境界値そのものを除外したい場合は、exclusive() を使用します:
RangeFilter {
roleName: "cpuUsage"
minimum: exclusive(70)
maximum: 100
}プロパティのドキュメント
maximum : variant
範囲の上限。role の値がこの値より大きい行は除外されます。設定されていない場合、上限はありません。
単純な値を指定すると、境界値を含む範囲となります。つまり、maximum に等しい行も受け入れられます。境界値自体を除外するには、exclusive() を使用してください。
minimum : variant
範囲の下限。role の値がこの値より小さい行は除外されます。設定されていない場合、下限はありません。
単純な値を指定すると、その値を含む範囲となります。つまり、minimum に等しい行も受け入れられます。境界値自体を除外するには、exclusive() を使用してください。
メソッドのドキュメント
variant exclusive(value)
範囲から「value 」を除外した境界を返します。「value 」に等しいrole値を持つ行は除外されます。
RangeFilter {
roleName: "score"
minimum: 0
maximum: RangeFilter.exclusive(100)© 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.