[−][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(
&self,
engine: impl CastInto<Ptr<QQmlEngine>>,
uri: *const c_char
)
[src]
&self,
engine: impl CastInto<Ptr<QQmlEngine>>,
uri: *const 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(
&self,
arg1: Call,
arg2: c_int,
arg3: *mut *mut c_void
) -> c_int
[src]
&self,
arg1: Call,
arg2: c_int,
arg3: *mut *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(&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)
.
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]
s: *const c_char,
c: *const 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: *const c_char,
c: *const c_char,
n: c_int
) -> CppBox<QString>
[src]
s: *const c_char,
c: *const 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(&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]
ptr: Ptr<QQmlExtensionInterface>
) -> Ptr<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)
.
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]
ptr: Ptr<QQmlExtensionInterface>
) -> Ptr<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)
.
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]
ptr: Ptr<QQmlExtensionPlugin>
) -> Ptr<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)
.
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]
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>,