[][src]Struct qt_qml::QQmlNetworkAccessManagerFactory

#[repr(C)]pub struct QQmlNetworkAccessManagerFactory { /* fields omitted */ }

A QML engine uses QNetworkAccessManager for all network access. By implementing a factory, it is possible to provide the QML engine with custom QNetworkAccessManager instances with specialized caching, proxy and cookies support.

C++ class: QQmlNetworkAccessManagerFactory.

C++ documentation:

A QML engine uses QNetworkAccessManager for all network access. By implementing a factory, it is possible to provide the QML engine with custom QNetworkAccessManager instances with specialized caching, proxy and cookies support.

To implement a factory, subclass QQmlNetworkAccessManagerFactory and implement the virtual create() method, then assign it to the relevant QML engine using QQmlEngine::setNetworkAccessManagerFactory().

Note the QML engine may create QNetworkAccessManager instances from multiple threads. Because of this, the implementation of the create() method must be reentrant. In addition, the developer should be careful if the signals of the object to be returned from create() are connected to the slots of an object that may be created in a different thread:

  • The QML engine internally handles all requests, and cleans up any QNetworkReply objects it creates. Receiving the QNetworkAccessManager::finished() signal in another thread may not provide the receiver with a valid reply object if it has already been deleted.
  • Authentication details provided to QNetworkAccessManager::authenticationRequired() must be provided immediately, so this signal cannot be connected as a Qt::QueuedConnection (or as the default Qt::AutoConnection from another thread).

For more information about signals and threads, see Threads and QObjects and Signals and Slots Across Threads.

Methods

impl QQmlNetworkAccessManagerFactory[src]

pub unsafe fn copy_from(
    &self,
    other: impl CastInto<Ref<QQmlNetworkAccessManagerFactory>>
) -> Ref<QQmlNetworkAccessManagerFactory>
[src]

A QML engine uses QNetworkAccessManager for all network access. By implementing a factory, it is possible to provide the QML engine with custom QNetworkAccessManager instances with specialized caching, proxy and cookies support.

Calls C++ function: QQmlNetworkAccessManagerFactory& QQmlNetworkAccessManagerFactory::operator=(const QQmlNetworkAccessManagerFactory& other).

C++ documentation:

A QML engine uses QNetworkAccessManager for all network access. By implementing a factory, it is possible to provide the QML engine with custom QNetworkAccessManager instances with specialized caching, proxy and cookies support.

To implement a factory, subclass QQmlNetworkAccessManagerFactory and implement the virtual create() method, then assign it to the relevant QML engine using QQmlEngine::setNetworkAccessManagerFactory().

Note the QML engine may create QNetworkAccessManager instances from multiple threads. Because of this, the implementation of the create() method must be reentrant. In addition, the developer should be careful if the signals of the object to be returned from create() are connected to the slots of an object that may be created in a different thread:

  • The QML engine internally handles all requests, and cleans up any QNetworkReply objects it creates. Receiving the QNetworkAccessManager::finished() signal in another thread may not provide the receiver with a valid reply object if it has already been deleted.
  • Authentication details provided to QNetworkAccessManager::authenticationRequired() must be provided immediately, so this signal cannot be connected as a Qt::QueuedConnection (or as the default Qt::AutoConnection from another thread).

For more information about signals and threads, see Threads and QObjects and Signals and Slots Across Threads.

Trait Implementations

impl CppDeletable for QQmlNetworkAccessManagerFactory[src]

unsafe fn delete(&self)[src]

Destroys the factory. The default implementation does nothing.

Calls C++ function: virtual [destructor] void QQmlNetworkAccessManagerFactory::~QQmlNetworkAccessManagerFactory().

C++ documentation:

Destroys the factory. The default implementation does nothing.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.