FunctionFilter QML Type
指定された 'filter' メソッドの評価に基づいて、SortFilterProxyModel のデータをフィルタリングする。詳細...
Import Statement: | import QtQml.Models |
Since: | Qt 6.10 |
Inherits: | |
Status: | Preliminary |
この型は開発中であり、変更される可能性があります。
詳細説明
FunctionFilter は、ユーザが指定した 'filter' メソッドを定義し、それを評価することでデータをフィルタリングする。filter'メソッドは1つの引数をとり、以下のようにインラインコンポーネントとして定義することができます:
SortFilterProxyModel { model: sourceModel filters: [ FunctionFilter { id: functionFilter property int ageLimit: 20 component RoleData: QtObject { property real age } function filter(data: RoleData) : bool { return (data.age <= ageLimit) } } ] }
注意: 指定した 'filter' メソッド内で使用される外部 qml プロパティが変更されるたびに、ユーザは明示的にSortFilterProxyModel::invalidate を呼び出す必要があります。この動作は暗黙の無効化のように将来変更される可能性があるため、ユーザーは明示的にSortFilterProxyModel::invalidate を呼び出す必要はありません。
© 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.