[Interest] QML/C++ interaction in Qt6
Ulf Hermann
ulf.hermann at qt.io
Sat Sep 12 09:24:15 CEST 2020
> Will Qt 6 still use the Meta information to access Qml properties or
> it rely more on compiled C++ now? I guess it still the same as
> before. Is the properties declaration of Qt for MCU (Qml lite or
> soemthign like that) be available (syntax wise, template)? That would
> leverage soo much redundent code to expose properties with get/set
> and changed event. That will be a slim fast for code that expose to
> Qml (to Meta data actually, Qml use the meta data) and maybe event
> make that layer disapear one day.
Registration of C++ types for QML in dev is largely unchanged from 5.15.
You get the QML_ELEMENT etc. macros we introduced in 5.15 to make the
registration as painless as possible. The indirection through the
metatype system is necessary for the case of dynamically interpreted
QML. We can generate C++ code from your QML to directly access your C++
types, but if you want to execute that same QML in interpreted mode,
those C++ types need to be visible to metatype system in order to be
accessible.
Also, the new property system is being introduced. If you provide a
BINDABLE property, you may be able to skip the READ, WRITE, and NOTIFY
methods in the future. This is still being worked on, though.
best,
Ulf
More information about the Interest
mailing list