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)
これは、新しいアグリゲートを作成し、すべてのcomponents をそれに追加する便利な関数です。もしコンポーネントがすでにアグリゲートに属している場合、残りのコンポーネントはそのアグリゲートに追加されます。コンポーネントは、最初から異なるアグリゲートに属してはなりません。
「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.