이 페이지에서

AllOfFilter QML Type

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

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

FilterBase

Status: Technology preview

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

속성

상세 설명

AllOfFilter는 일련의 하위 필터를 그룹화하여, 모든 하위 필터가 해당 행 또는 열을 허용할 때만 일치하는 행이나 열을 찾습니다. 이는 SortFilterProxyModel 에 여러 필터를 직접 적용하는 것과 동일하지만, 그룹 자체를 하나의 단위로 활성화, 비활성화 또는 반전시킬 수 있습니다.

다음 코드 예제는 AllOfFilter를 사용하여 status 가 "active" 이고 favorite 가 true 인 행만 포함하는 방법을 보여줍니다:

SortFilterProxyModel {
    sourceModel: model
    filters: [
        AllOfFilter {
            ValueFilter {
                roleName: "parent";
                value: "root"
            }
            ValueFilter {
                roleName: "status";
                value: "active"
            }
        }
    ]
}

속성 설명서

filters : list<FilterBase>

논리 AND 연산으로 평가되는 하위 필터 목록입니다. 이 목록에 포함된 모든 필터가 해당 행을 허용하는 경우에만 해당 행이 허용됩니다.

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

AllOfFilter {
    ValueFilter { roleName: "status"; value: "active" }
    ValueFilter { roleName: "parent"; value: "root" }
}

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