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

Using modules

Before using each of the Qt 3D modules, you have to enable the module separately in the project file. For example, the following line will enable all currently documented modules:

QT += 3dcore 3drender 3dinput 3dlogic 3danimation \      qml quick 3dquick 3dquickextras 3dquickscene2d

When using QML, each module must also be separately imported:

import Qt3D.Core 2.10import Qt3D.Render 2.10import Qt3D.Extras 2.10import Qt3D.Input 2.0import Qt3D.Logic 2.0import QtQuick.Scene2D 2.9import QtQuick.Scene3D 2.0
You can see that different Qt 3D modules have different QML module versions. Some modules were updated in Qt 5.10 and have new features that we'd like to use in our code, so you have to specify the last version (2.10) to make new QML ...

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