O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required