What just happened?

In this exercise, we let the QML runtime know about two new elements. One of them is CarInfo, which is a proxy to our widget class. We told the engine that this is a full-featured class that is instantiable from QML. The other class, CarInfoEngine, also became known to QML; however, the difference is that every attempt to declare an object of this type in QML fails with a given warning message. There are other functions available for registering types in QML, but they are rarely used, so we will not be describing them here. If you are curious about them, type in qmlRegister in the Index tab of Creator's Help pane.

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.