이 페이지에서

AnyOfFilter QML Type

SortFilterProxyModel 에서 논리 OR 연산을 사용하여 여러 필터를 결합합니다. 더 보기...

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

FilterBase

Status: Technology preview

이 유형은 기술 미리보기 단계에 있으며 변경될 수 있습니다.

속성

상세 설명

AnyOfFilter는 일련의 하위 필터를 그룹화하고, 해당 그룹 내의 하위 필터 중 적어도 하나에 해당하는 행 또는 열을 찾습니다. 이는 행을 포함시키기 위해 여러 개의 독립적인 조건이 있지만, 모든 조건이 충족될 필요는 없는 경우에 유용합니다.

다음 코드 예제는 AnyOfFilter를 사용하여 status 가 "active" 이거나 "pending" 인 행을 포함하는 방법을 보여줍니다:

SortFilterProxyModel {
    sourceModel: model
    filters: [
        AnyOfFilter {
            ValueFilter {
                roleName: "status"
                value: "active"
            }
            ValueFilter {
                roleName: "status"
                value: "pending"
            }
        }
    ]
}

속성 설명서

filters : list<FilterBase>

논리 OR 연산으로 평가되는 하위 필터 목록입니다. 이 목록에 포함된 필터 중 하나 이상이 해당 행을 허용하면 해당 행이 허용됩니다.

이는 기본 속성이므로, ` filters ` 키워드 없이도 필터를 직접 자식으로 선언할 수 있습니다:

AnyOfFilter {
    ValueFilter { roleName: "status"; value: "active" }
    ValueFilter { roleName: "status"; value: "pending" }
}

© 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.