|  | Home · All Classes · Modules

# QDeclarativeNetworkAccessManagerFactory Class Reference
[QtDeclarative module]

The QDeclarativeNetworkAccessManagerFactory class provides a factory for QNetworkAccessManager for use by a Qt Declarative engine. More...

### Methods

- __init__ (self)
- __init__ (self, QDeclarativeNetworkAccessManagerFactory)
- QNetworkAccessManager create (self, QObject parent)

## Detailed Description

The QDeclarativeNetworkAccessManagerFactory class provides a factory for QNetworkAccessManager for use by a Qt Declarative engine.

QNetworkAccessManager is used for all network access by QML. By implementing a factory it is possible to create custom QNetworkAccessManager with specialized caching, proxy and cookie support.

To implement a factory, subclass QDeclarativeNetworkAccessManagerFactory and implement the create() method.

To use a factory, assign it to the relevant QDeclarativeEngine using QDeclarativeEngine.setNetworkAccessManagerFactory().

Note: the create() method may be called by multiple threads, so ensure the implementation of this method is reentrant.

## Method Documentation

### QDeclarativeNetworkAccessManagerFactory.__init__ (self)

### QDeclarativeNetworkAccessManagerFactory.__init__ (self, QDeclarativeNetworkAccessManagerFactory)

### QNetworkAccessManager QDeclarativeNetworkAccessManagerFactory.create (self, QObject parent)

This method is abstract and should be reimplemented in any sub-class.

The parent argument, if not None, causes self to be owned by Qt instead of PyQt.

Implement this method to create a QNetworkAccessManager with parent. This allows proxies, caching and cookie support to be setup appropriately.

This method must return a new QNetworkAccessManager each time it is called. The parent of the QNetworkAccessManager must be the parent provided. The QNetworkAccessManager(s) created by this function will be destroyed automatically when their parent is destroyed.

Note: this method may be called by multiple threads, so ensure the implementation of this method is reentrant.