[][src]Struct qt_qml::QQmlAbstractUrlInterceptor

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

QQmlAbstractUrlInterceptor is an interface which can be used to alter URLs before they are used by the QML engine. This is primarily useful for altering file urls into other file urls, such as selecting different graphical assets for the current platform.

C++ class: QQmlAbstractUrlInterceptor.

C++ documentation:

QQmlAbstractUrlInterceptor is an interface which can be used to alter URLs before they are used by the QML engine. This is primarily useful for altering file urls into other file urls, such as selecting different graphical assets for the current platform.

Relative URLs are intercepted after being resolved against the file path of the current QML context. URL interception also occurs after setting the base path for a loaded QML file. This means that the content loaded for that QML file uses the intercepted URL, but inside the file the pre-intercepted URL is used for resolving relative paths. This allows for interception of .qml file loading without needing all paths (or local types) inside intercepted content to insert a different relative path.

Compared to setNetworkAccessManagerFactory, QQmlAbstractUrlInterceptor affects all URLs and paths, including local files and embedded resource files. QQmlAbstractUrlInterceptor is synchronous, and for asynchronous files must return a url with an asynchronous scheme (such as http or a custom scheme handled by your own custom QNetworkAccessManager). You can use a QQmlAbstractUrlInterceptor to change file URLs into networked URLs which are handled by your own custom QNetworkAccessManager.

To implement support for a custom networked scheme, see setNetworkAccessManagerFactory.

Methods

impl QQmlAbstractUrlInterceptor[src]

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

QQmlAbstractUrlInterceptor is an interface which can be used to alter URLs before they are used by the QML engine. This is primarily useful for altering file urls into other file urls, such as selecting different graphical assets for the current platform.

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

C++ documentation:

QQmlAbstractUrlInterceptor is an interface which can be used to alter URLs before they are used by the QML engine. This is primarily useful for altering file urls into other file urls, such as selecting different graphical assets for the current platform.

Relative URLs are intercepted after being resolved against the file path of the current QML context. URL interception also occurs after setting the base path for a loaded QML file. This means that the content loaded for that QML file uses the intercepted URL, but inside the file the pre-intercepted URL is used for resolving relative paths. This allows for interception of .qml file loading without needing all paths (or local types) inside intercepted content to insert a different relative path.

Compared to setNetworkAccessManagerFactory, QQmlAbstractUrlInterceptor affects all URLs and paths, including local files and embedded resource files. QQmlAbstractUrlInterceptor is synchronous, and for asynchronous files must return a url with an asynchronous scheme (such as http or a custom scheme handled by your own custom QNetworkAccessManager). You can use a QQmlAbstractUrlInterceptor to change file URLs into networked URLs which are handled by your own custom QNetworkAccessManager.

To implement support for a custom networked scheme, see setNetworkAccessManagerFactory.

pub unsafe fn intercept(
    &self,
    path: impl CastInto<Ref<QUrl>>,
    type_: DataType
) -> CppBox<QUrl>
[src]

A pure virtual function where you can intercept the url. The returned value is taken as the new value for the url. The type of url being intercepted is given by the type variable.

Calls C++ function: pure virtual QUrl QQmlAbstractUrlInterceptor::intercept(const QUrl& path, QQmlAbstractUrlInterceptor::DataType type).

C++ documentation:

A pure virtual function where you can intercept the url. The returned value is taken as the new value for the url. The type of url being intercepted is given by the type variable.

Your implementation of this function must be thread-safe, as it can be called from multiple threads at the same time.

Trait Implementations

impl CppDeletable for QQmlAbstractUrlInterceptor[src]

unsafe fn delete(&self)[src]

Destructor for QQmlAbstractUrlInterceptor.

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

C++ documentation:

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.