woboq/qmetaobject-rs

Missing API wrapper for qmlRegisterModule

gikari opened this issue · 4 comments

Summary

There is no Rust function for qmlRegisterModule Qt method.

Hi, thanks for the report!

Let me quickly add it right now.

This is a quite marginal feature, very rarely used. I don't recall any instance of it in the source code that I browsed. Out of curiosity, what's your use-case for it?

I was porting QML extension from C++ to Rust, and it was just in the codebase. Maybe I erroneously used it, when dealing with Qt Plugins for the first time. Perhaps it is not required, but here is the old C++ snippet:

void DBusPlugin::registerTypes(const char *uri)
{
    Q_ASSERT(uri == QLatin1String("org.kde.bismuth.dbus"));
    qmlRegisterModule(uri, 1, 0);

    qmlRegisterType<DBusService>(uri, 1, 0, "DBusService");
}

Looks like it is not required in your snippet. See QTBUG-84571.

Still worth adding a wrapper, just in case.