O'Reilly logo

Game Programming Using Qt by Lorenz Haas, Witold Wysota

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

Time for action – self-updating car dashboard

In the next exercise, we will implement a car dashboard that can be used in a racing game and will show a number of parameters such as current speed and motor revolutions per minute. The final result will look similar to the following image:

Time for action – self-updating car dashboard

We will start with the C++ part. Set up a new Qt Quick Application. Choose the most recent Qt Quick version for the Qt Quick component set. This will generate a main function for you that instantiates QGuiApplication and QQmlApplicationEngine and sets them up to load a QML document.

Use the File menu to create New file or Project and create a new C++ class. Call it ...

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