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

Embedding Qt Quick UI into a 3D scene

Qt 3D allows you to embed an arbitrary Qt Quick item into your 3D scene using the Scene2D type. How does that work? First, you need to put your Qt Quick content into a new Scene2D object. Next, you need to declare a texture that will be used as a render target for the form. Whenever Qt Quick decides to update its virtual view, the Scene2D object will render it directly to the specified texture. You only need to display this texture as you want. The most simple way of doing that is to pass it to a TextureMaterial component attached to one of your 3D objects. 

However, this is only one part of the job. It's nice to allow users to see your form, but they should also be able to interact with it. This is also ...

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