Aggregation Namespace
Aggregation 네임스페이스는 관련 컴포넌트를 묶어 관리할 수 있도록 지원하므로, 각 컴포넌트가 다른 컴포넌트의 속성과 동작을 외부로 노출할 수 있습니다. 더 보기...
| Header: | #include <Aggregation> |
클래스
| class | Aggregate |
함수
| void | aggregate(const QObjectList &components) |
| T * | query(QObject *obj) |
| QList<T *> | query_all(QObject *obj) |
상세 설명
어그리게이트로 묶인 컴포넌트는 서로 형변환이 가능하며, 결합된 수명 주기를 가집니다. 자세한 내용과 예제는 Aggregation::Aggregate 문서를 참조하십시오.
함수 문서
void Aggregation::aggregate(const QObjectList &components)
이 함수는 새로운 Aggregate를 생성하고 모든 components 를 그 안에 추가하는 편의 함수입니다. 만약 어떤 컴포넌트가 이미 Aggregate에 속해 있다면, 나머지 컴포넌트는 해당 Aggregate에 추가됩니다. 컴포넌트는 처음부터 서로 다른 Aggregate에 속해 있어서는 안 됩니다.
Aggregate도 참조하십시오 .
template <typename T> T *query(QObject *obj)
obj 가 속할 가능성이 있는 집합체를 고려한 동적 형 변환을 수행합니다. obj 자체가 요청된 유형인 경우, 단순히 형 변환되어 반환됩니다. 그렇지 않은 경우, obj 가 집합체에 속하면 그 모든 구성 요소가 확인됩니다. 집합체에 속하지 않는 경우 null이 반환됩니다.
Aggregate::component()도 참조하십시오 .
template <typename T> QList<T *> query_all(QObject *obj)
obj 가 집합체에 속하는 경우, 주어진 유형으로 형변환할 수 있는 모든 구성 요소가 반환됩니다. 그렇지 않은 경우, obj 가 요청된 유형과 일치하면 해당 값이 반환됩니다.
Aggregate::components()도 참조하십시오 .
Copyright © The Qt Company Ltd. and other contributors. 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.