Qt Reference Documentation

QDeclarativeNetworkAccessManagerFactory Class Reference

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

 #include <QDeclarativeNetworkAccessManagerFactory>

This class was introduced in Qt 4.7.

Public Functions

virtual ~QDeclarativeNetworkAccessManagerFactory ()
virtual QNetworkAccessManager * create ( QObject * parent ) = 0

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.

See also QDeclarativeEngine::setNetworkAccessManagerFactory() and NetworkAccessManagerFactory example.

Member Function Documentation

QDeclarativeNetworkAccessManagerFactory::~QDeclarativeNetworkAccessManagerFactory () [virtual]

The destructor is empty.

QNetworkAccessManager * QDeclarativeNetworkAccessManagerFactory::create ( QObject * parent ) [pure virtual]

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.

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.