[−][src]Struct qt_qml::QQmlExtensionPlugin
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.
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:
- Subclass QQmlExtensionPlugin
- Use the Q_PLUGIN_METADATA() macro to register the plugin with the Qt meta object system
- Override the registerTypes() method and call qmlRegisterType() to register the types to be exported by the plugin
- Write a project file for the plugin
- 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.
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(
&mut self,
engine: impl CastInto<MutPtr<QQmlEngine>>,
uri: impl CastInto<Ptr<c_char>>
)[src]
&mut self,
engine: impl CastInto<MutPtr<QQmlEngine>>,
uri: impl CastInto<Ptr<c_char>>
)
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).
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(
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int[src]
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
Calls C++ function: virtual int QQmlExtensionPlugin::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).
pub unsafe fn qt_metacast(
&mut self,
arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>[src]
&mut self,
arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
Calls C++ function: virtual void* QQmlExtensionPlugin::qt_metacast(const char* arg1).
pub unsafe fn register_types(&mut self, uri: impl CastInto<Ptr<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).
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: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>[src]
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>
Calls C++ function: static QString QQmlExtensionPlugin::tr(const char* s, const char* c, int n).
pub unsafe fn tr_utf8(
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>[src]
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>
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(&mut 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 DerefMut for QQmlExtensionPlugin[src]
fn deref_mut(&mut self) -> &mut 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).
unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<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]
ptr: Ptr<QQmlExtensionInterface>
) -> Ptr<QQmlExtensionPlugin>
Calls C++ function: QQmlExtensionPlugin* dynamic_cast<QQmlExtensionPlugin*>(QQmlExtensionInterface* ptr).
unsafe fn dynamic_cast_mut(
ptr: MutPtr<QQmlExtensionInterface>
) -> MutPtr<QQmlExtensionPlugin>[src]
ptr: MutPtr<QQmlExtensionInterface>
) -> MutPtr<QQmlExtensionPlugin>
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]
ptr: Ptr<QQmlTypesExtensionInterface>
) -> Ptr<QQmlExtensionPlugin>
Calls C++ function: QQmlExtensionPlugin* dynamic_cast<QQmlExtensionPlugin*>(QQmlTypesExtensionInterface* ptr).
unsafe fn dynamic_cast_mut(
ptr: MutPtr<QQmlTypesExtensionInterface>
) -> MutPtr<QQmlExtensionPlugin>[src]
ptr: MutPtr<QQmlTypesExtensionInterface>
) -> MutPtr<QQmlExtensionPlugin>
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).
unsafe fn static_downcast_mut(
ptr: MutPtr<QObject>
) -> MutPtr<QQmlExtensionPlugin>[src]
ptr: MutPtr<QObject>
) -> MutPtr<QQmlExtensionPlugin>
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]
ptr: Ptr<QQmlExtensionInterface>
) -> Ptr<QQmlExtensionPlugin>
Calls C++ function: QQmlExtensionPlugin* static_cast<QQmlExtensionPlugin*>(QQmlExtensionInterface* ptr).
unsafe fn static_downcast_mut(
ptr: MutPtr<QQmlExtensionInterface>
) -> MutPtr<QQmlExtensionPlugin>[src]
ptr: MutPtr<QQmlExtensionInterface>
) -> MutPtr<QQmlExtensionPlugin>
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]
ptr: Ptr<QQmlTypesExtensionInterface>
) -> Ptr<QQmlExtensionPlugin>
Calls C++ function: QQmlExtensionPlugin* static_cast<QQmlExtensionPlugin*>(QQmlTypesExtensionInterface* ptr).
unsafe fn static_downcast_mut(
ptr: MutPtr<QQmlTypesExtensionInterface>
) -> MutPtr<QQmlExtensionPlugin>[src]
ptr: MutPtr<QQmlTypesExtensionInterface>
) -> MutPtr<QQmlExtensionPlugin>
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).
unsafe fn static_upcast_mut(ptr: MutPtr<QQmlExtensionPlugin>) -> MutPtr<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]
ptr: Ptr<QQmlExtensionPlugin>
) -> Ptr<QQmlExtensionInterface>
Calls C++ function: QQmlExtensionInterface* static_cast<QQmlExtensionInterface*>(QQmlExtensionPlugin* ptr).
unsafe fn static_upcast_mut(
ptr: MutPtr<QQmlExtensionPlugin>
) -> MutPtr<QQmlExtensionInterface>[src]
ptr: MutPtr<QQmlExtensionPlugin>
) -> MutPtr<QQmlExtensionInterface>
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]
ptr: Ptr<QQmlExtensionPlugin>
) -> Ptr<QQmlTypesExtensionInterface>
Calls C++ function: QQmlTypesExtensionInterface* static_cast<QQmlTypesExtensionInterface*>(QQmlExtensionPlugin* ptr).
unsafe fn static_upcast_mut(
ptr: MutPtr<QQmlExtensionPlugin>
) -> MutPtr<QQmlTypesExtensionInterface>[src]
ptr: MutPtr<QQmlExtensionPlugin>
) -> MutPtr<QQmlTypesExtensionInterface>
Calls C++ function: QQmlTypesExtensionInterface* static_cast<QQmlTypesExtensionInterface*>(QQmlExtensionPlugin* ptr).
Auto Trait Implementations
impl RefUnwindSafe for QQmlExtensionPlugin
impl Send for QQmlExtensionPlugin
impl Sync for QQmlExtensionPlugin
impl Unpin for QQmlExtensionPlugin
impl UnwindSafe for QQmlExtensionPlugin
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>, [src]
U: CastFrom<T>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> StaticUpcast<T> for T[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,