[][src]Struct qt_qml::QQmlExtensionPlugin

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

QQmlExtensionPlugin is a plugin interface that makes it possible to create QML extensions that can be loaded dynamically into QML applications. These extensions allow custom QML types to be made available to the QML engine.

C++ class: QQmlExtensionPlugin.

C++ documentation:

QQmlExtensionPlugin is a plugin interface that makes it possible to create QML extensions that can be loaded dynamically into QML applications. These extensions allow custom QML types to be made available to the QML engine.

To write a QML extension plugin:

  1. Subclass QQmlExtensionPlugin
  2. Write a project file for the plugin
  3. Create a qmldir file to describe the plugin

QML extension plugins are for either application-specific or library-like plugins. Library plugins should limit themselves to registering types, as any manipulation of the engine's root context may cause conflicts or other issues in the library user's code.

Methods

impl QQmlExtensionPlugin[src]

pub unsafe fn base_url(&self) -> CppBox<QUrl>[src]

Returns the URL of the directory from which the extension is loaded.

Calls C++ function: QUrl QQmlExtensionPlugin::baseUrl() const.

C++ documentation:

Returns the URL of the directory from which the extension is loaded.

This is useful when the plugin also needs to load QML files or other assets from the same directory.

This function was introduced in Qt 5.1.

pub unsafe fn initialize_engine(
    &self,
    engine: impl CastInto<Ptr<QQmlEngine>>,
    uri: *const c_char
)
[src]

Initializes the extension from the uri using the engine. Here an application plugin might, for example, expose some data or objects to QML, as context properties on the engine's root context.

Calls C++ function: virtual void QQmlExtensionPlugin::initializeEngine(QQmlEngine* engine, const char* uri).

C++ documentation:

Initializes the extension from the uri using the engine. Here an application plugin might, for example, expose some data or objects to QML, as context properties on the engine's root context.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QQmlExtensionPlugin::metaObject() const.

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QQmlExtensionPlugin::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QQmlExtensionPlugin::qt_metacast(const char* arg1).

pub unsafe fn register_types(&self, uri: *const c_char)[src]

Registers the QML types in the given uri. Subclasses should implement this to call qmlRegisterType() for all types which are provided by the extension plugin.

Calls C++ function: pure virtual void QQmlExtensionPlugin::registerTypes(const char* uri).

C++ documentation:

Registers the QML types in the given uri. Subclasses should implement this to call qmlRegisterType() for all types which are provided by the extension plugin.

The uri is an identifier for the plugin generated by the QML engine based on the name and path of the extension's plugin library.

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QQmlExtensionPlugin::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QQmlExtensionPlugin::trUtf8(const char* s, const char* c, int n).

Trait Implementations

impl CppDeletable for QQmlExtensionPlugin[src]

unsafe fn delete(&self)[src]

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

impl Deref for QQmlExtensionPlugin[src]

type Target = QObject

The resulting type after dereferencing.

fn deref(&self) -> &QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QQmlExtensionPlugin* ptr).

impl DynamicCast<QQmlExtensionPlugin> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QQmlExtensionPlugin>[src]

Calls C++ function: QQmlExtensionPlugin* dynamic_cast<QQmlExtensionPlugin*>(QObject* ptr).

impl DynamicCast<QQmlExtensionPlugin> for QQmlExtensionInterface[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QQmlExtensionInterface>
) -> Ptr<QQmlExtensionPlugin>
[src]

Calls C++ function: QQmlExtensionPlugin* dynamic_cast<QQmlExtensionPlugin*>(QQmlExtensionInterface* ptr).

impl DynamicCast<QQmlExtensionPlugin> for QQmlTypesExtensionInterface[src]

unsafe fn dynamic_cast(
    ptr: Ptr<QQmlTypesExtensionInterface>
) -> Ptr<QQmlExtensionPlugin>
[src]

Calls C++ function: QQmlExtensionPlugin* dynamic_cast<QQmlExtensionPlugin*>(QQmlTypesExtensionInterface* ptr).

impl StaticDowncast<QQmlExtensionPlugin> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QQmlExtensionPlugin>[src]

Calls C++ function: QQmlExtensionPlugin* static_cast<QQmlExtensionPlugin*>(QObject* ptr).

impl StaticDowncast<QQmlExtensionPlugin> for QQmlExtensionInterface[src]

unsafe fn static_downcast(
    ptr: Ptr<QQmlExtensionInterface>
) -> Ptr<QQmlExtensionPlugin>
[src]

Calls C++ function: QQmlExtensionPlugin* static_cast<QQmlExtensionPlugin*>(QQmlExtensionInterface* ptr).

impl StaticDowncast<QQmlExtensionPlugin> for QQmlTypesExtensionInterface[src]

unsafe fn static_downcast(
    ptr: Ptr<QQmlTypesExtensionInterface>
) -> Ptr<QQmlExtensionPlugin>
[src]

Calls C++ function: QQmlExtensionPlugin* static_cast<QQmlExtensionPlugin*>(QQmlTypesExtensionInterface* ptr).

impl StaticUpcast<QObject> for QQmlExtensionPlugin[src]

unsafe fn static_upcast(ptr: Ptr<QQmlExtensionPlugin>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QQmlExtensionPlugin* ptr).

impl StaticUpcast<QQmlExtensionInterface> for QQmlExtensionPlugin[src]

unsafe fn static_upcast(
    ptr: Ptr<QQmlExtensionPlugin>
) -> Ptr<QQmlExtensionInterface>
[src]

Calls C++ function: QQmlExtensionInterface* static_cast<QQmlExtensionInterface*>(QQmlExtensionPlugin* ptr).

impl StaticUpcast<QQmlTypesExtensionInterface> for QQmlExtensionPlugin[src]

unsafe fn static_upcast(
    ptr: Ptr<QQmlExtensionPlugin>
) -> Ptr<QQmlTypesExtensionInterface>
[src]

Calls C++ function: QQmlTypesExtensionInterface* static_cast<QQmlTypesExtensionInterface*>(QQmlExtensionPlugin* ptr).

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.