Trait qmetaobject::qtdeclarative::QQmlExtensionPlugin[][src]

pub trait QQmlExtensionPlugin: QObject {
    fn register_types(&mut self, uri: &CStr);
}
Expand description

A QObject-like trait to inherit from QQmlExtensionPlugin.

Refer to the Qt documentation of QQmlExtensionPlugin

See also the ‘qmlextensionplugins’ example.

use qmetaobject::*;
use std::ffi::CStr;

#[derive(Default, QObject)]
struct QExampleQmlPlugin {
    base: qt_base_class!(trait QQmlExtensionPlugin),
    plugin: qt_plugin!("org.qt-project.Qt.QQmlExtensionInterface/1.0"),
}

impl QQmlExtensionPlugin for QExampleQmlPlugin {
    fn register_types(&mut self, uri: &CStr) {
        // call `qml_register_type` here
    }
}

Required methods

Refer to the Qt documentation of QQmlExtensionPlugin::registerTypes

Implementors