Network Components

If the URL passed to QDeclarativeComponent is a network resource, or if the QML document references a network resource, the QDeclarativeComponent has to fetch the network data before it is able to create objects. In this case, the QDeclarativeComponent will have a Loadingstatus. An application will have to wait until the component is Ready before calling QDeclarativeComponent::create().

The following example shows how to load a QML file from a network resource. After creating the QDeclarativeComponent, it tests whether the component is loading. If it is, it connects to the QDeclarativeComponent::statusChanged() signal and otherwise calls the continueLoading() method directly. Note that QDeclarativeComponent::isLoading() may be false for a network component if the component has been cached and is ready immediately.

This breaking point is sometimes useful when using attached properties to communicate information to an instantiated component, as it allows their initial values to be configured before property bindings take effect.

void QDeclarativeComponent::completeCreate () [virtual]

This method provides more advanced control over component instance creation. In general, programmers should use QDeclarativeComponent::create() to create a component.