Extending Qt Creator Manual | Aggregation Namespace

Extending Qt Creator Manual 4.5.2

# Aggregation Namespace

The Aggregation namespace contains support for bundling related components, such that each component exposes the properties and behavior of the other components to the outside. More...

Header: | #include <Aggregation>

## Classes

class | Aggregate

## Functions

T * | query(QObject *obj)
QList<T *> | query_all(QObject *obj)

## Detailed Description

The Aggregation namespace contains support for bundling related components, such that each component exposes the properties and behavior of the other components to the outside.

Components that are bundled to an Aggregate can be "cast" to each other and have a coupled life cycle. See the documentation of Aggregation::Aggregate for details and examples.

## Classes

### class Aggregate

The Aggregate class defines a collection of related components that can be viewed as a unit. More...

## Function Documentation

### T *Aggregation::query(QObject *obj)

Performs a dynamic cast that is aware of a possible Aggregate that obj might belong to. If obj itself is of the requested type then it is simply cast and returned. Otherwise, if obj belongs to an Aggregate all its components are checked, or if it doesn't belong to an Aggregate null is returned.

See also Aggregate::component().

### QList<T *> Aggregation::query_all(QObject *obj)

If obj belongs to an Aggregate, all components that can be cast to the given type are returned. Otherwise, obj is returned if it is of the requested type.

See also Aggregate::components().