[Interest] Can QML compiler optimize switch into array indexing?

Ulf Hermann ulf.hermann at qt.io
Fri Oct 15 09:29:51 CEST 2021


> I now saw your nice blog post about this at [1], saying "You should
> not call qmlRegisterType() and friends procedurally anymore.".
> 
> I then saw that there's no pointer in the docs for qmlRegisterType and
> friends [2] to QML_ELEMENT.

There are quite a few links from the qmlRegisterType() family of 
functions to their macro counter parts. For each one there is a "See 
also" below it and the macros are documented on the same page.

The general documentation on how to define QML types from C++ can be 
found at [1]. It only mentions the macros.

[1] https://doc.qt.io/qt-6/qtqml-cppintegration-definetypes.html

best regards,
Ulf


More information about the Interest mailing list