[][src]Function qt_qml::qml_register_type

pub unsafe fn qml_register_type(
    url: impl CastInto<Ref<QUrl>>,
    uri: *const c_char,
    version_major: c_int,
    version_minor: c_int,
    qml_name: *const c_char
) -> c_int

This function registers a type in the QML system with the name qmlName, in the library imported from uri having the version number composed from versionMajor and versionMinor. The type is defined by the QML file located at url. The url must be an absolute URL, i.e. url.isRelative() == false.

Calls C++ function: int qmlRegisterType(const QUrl& url, const char* uri, int versionMajor, int versionMinor, const char* qmlName).

C++ documentation:

This function registers a type in the QML system with the name qmlName, in the library imported from uri having the version number composed from versionMajor and versionMinor. The type is defined by the QML file located at url. The url must be an absolute URL, i.e. url.isRelative() == false.

Normally QML files can be loaded as types directly from other QML files, or using a qmldir file. This function allows registration of files to types from C++ code, such as when the type mapping needs to be procedurally determined at startup.

Returns -1 if the registration was not successful.