Skip to main content

qml_register_singleton_type

Function qml_register_singleton_type 

Source
pub fn qml_register_singleton_type<T: QObject + QSingletonInit + Sized + Default>(
    uri: &CStr,
    version_major: u32,
    version_minor: u32,
    qml_name: &CStr,
)
Expand description

Register the specified type as a singleton QML object.

A new object will be default-constructed for each new instance of QmlEngine. After construction of the corresponding C++ object the QSingletonInit::init() function will be called.

Refer to the Qt documentation for qmlRegisterSingletonType.

ยงPanics

The process will be aborted when the default or init functions panic.