November 2018
Intermediate to advanced
1150 pages
24h 11m
English
There are two main paths to expose C++ code to QML: we can either expose already instantiated C++ objects to a QML engine's context or, alternatively, register C++ classes as QML types, and then create object instances on the QML side.
Each of the two techniques has got its advantages and usage scenarios. Broadly speaking, we'd want to pass C++ object instances to QML if we wanted some C++ application layer to be in control of the object's lifetime; conversely, we would wrap a C++ class as a QML type if we wanted some QML layer run by the QML/JS engine to be in charge of the object's lifetime.
Read now
Unlock full access