[Development] Another method of registering QML types

Olivier Goffart olivier at woboq.com
Thu Nov 8 19:14:52 CET 2012


On Thursday 08 November 2012 09:57:05 Alan Alpert wrote:
> Currently, there is no way to register QML files as types from C++.
> This is the exact same functionality that qmldir provides, but I think
> there are situations where you'll want to do this progamatically
> instead of with a qmldir file. There is a very specific example I have
> in mind: Platform Components.
> 
> I'm suggesting another qmlRegisterTypes function, one that takes a URL
> instead of a C++ type:
> 
> qmlRegisterType(const char* url, const char *uri, int versionMajor,
> int versionMinor, const char *qmlName).

Paths should be QString.
We support unicode paths.

[...]
> Since this is adding to public API, I have a bigger question. Where
> does this change go? I did the PoC in Qt 4.8 because it was easier, is
> there a branch for 4.9/master that I didn't see in the 4.x series? Or
> does that no longer get functionality additions, and this should be
> going into 5.x only?

This is going to be 5.1,  as 5.0 is already frozen.
And yes, there is no plans for 4.9, and even if there was, commits need to go 
to Qt5 first.

-- 
Olivier

Woboq - Qt services and support - http://woboq.com




More information about the Development mailing list