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

Elvis Stansvik elvstone at gmail.com
Fri Oct 15 09:39:26 CEST 2021


Den fre 15 okt. 2021 kl 09:29 skrev Ulf Hermann <ulf.hermann at qt.io>:
>
> > 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.

It's decided: I've gone blind. Thanks.

>
> 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

Ah thanks. I also missed that overview somehow.

Elvis

>
> best regards,
> Ulf


More information about the Interest mailing list