
Medical Device Prototype Development: From Software Design to Regulatory Testing
I’m not going to lie, a lot of the projects we do at Scythe Studio are related to the medical […]
Join us at Qt C++ Warsaw Meetup - 21.08.2025
Sign up for free!Welcome to this comprehensive guide on 3D graphics in Qt. In this article, we’ll explore three main ways you can bring 3D content to life in your Qt applications:
We’ll go through the strengths and limitations of each approach and help you choose the best fit for your next project. While we’ll compare all the options, we believe Qt Quick 3D is the most compelling choice — that’s why we’ll focus on it in the example and mini tutorial that follow. You’ll see Qt Quick 3D in action and get a head start on building your own 3D applications.
If you’re diving into Qt development and need support or guidance, don’t hesitate to contact us. Whether you need help integrating 3D into your Qt applications or navigating through the Qt ecosystem, we’re here to assist!
Qt 3D offers an entity–component system (ECS) that lets you assemble a scene from generic QEntity objects to which rendering, input, physics or animation components are attached. A flexible frame-graph describes how every frame is rendered, so you can build deferred renderers, shadow passes, multi-viewport setups and more without touching GPU APIs.
If you’re working on a Qt 3D-based project and considering a migration — which we generally recommend — feel free to reach out to us. We can help you plan and execute the transition efficiently.
Qt Quick 3D extends the Qt Quick scene graph with spatial nodes, so 2D and 3D items share the same renderer and timing model. You describe scenes in QML (Model, Camera, Light, Material, etc.) and get designer-ready tooling in Qt Design Studio.
To see how powerful and intuitive Qt Quick 3D can be, check out our demo of Brain Viewer – a 3D model of the human brain created using Qt Quick 3D. This example showcases the potential of Qt Quick 3D for medical and educational applications, and how it can be used to visualize complex 3D data in an interactive and user-friendly way.
Qt exposes the GPU through QOpenGLWidget (legacy) and the modern QRhi abstraction (QRhiWidget, QRhi::create()). This route leaves all rendering decisions to your engine.
Criterion | Qt Quick 3D | Qt 3D | Low-Level OpenGL/Vulkan |
---|---|---|---|
API style | Declarative QML, small C++ helpers | ECS C++ & QML | Raw C++ shaders & command buffers |
Renderer | Integrated with Quick scene graph | Separate aspect/thread pool | Your own or third-party |
Performance | Optimised for UI, good on desktop; limited on GLES 2 | Acceptable but heavier; threading cost on some GPUs | Max – entirely on you |
Custom passes | Limited (custom materials & post-FX via shader code — or import from external tools like Blender) | Full frame-graph control | Unlimited |
Tooling | Qt Design Studio, Balsam importer | Minimal; manual asset prep | External (RenderDoc, Nsight, etc.) |
Licensing (open source) | GPL-3 | LGPL-3 | Depends on Qt edition you link against |
Status / roadmap | Actively developed; new features every minor | Deprecated, removed from 6.8 | Core Qt APIs stable; you own future work |
Ideal use cases | Dashboards, HMIs, mixed 2D/3D UIs | Simulation, CAD, custom renderers that lean on ECS | Game engines, scientific vis, legacy engine embedding |
The Qt framework now clearly positions Qt Quick 3D as its forward-looking 3D layer, with Qt 3D entering maintenance mode and low-level OpenGL/Vulkan reserved for niche, maximum-control scenarios. Evaluate your functional needs, licensing model and team expertise against the table above to pick the most sustainable path for your next 3D-enabled application.
If you’re currently using Qt 3D and considering migrating to Qt Quick 3D, the transition can be relatively smooth, especially if your application relies on standard 3D elements such as models, cameras, and lights. While Qt Quick 3D offers a more modern and high-level API, it doesn’t have the same low-level control as Qt 3D. This means that some custom rendering techniques or complex frame-graph setups may need to be reworked. However, the flexibility and the integration with the Qt Quick scene graph make it an appealing choice for new projects. If you’re familiar with QML, you’ll likely find the transition to Qt Quick 3D easy, especially with the many designer tools available.
During work on many different apps, I always “thought” only in 2 dimensions and it turned out to be kind of a trap. When you think about it there are plenty of cases when you need one extra dimension in your app. Let’s take the software for a 3D printer as an example. How can rendering a preview of a model to print be implemented only in two dimensions? This is why I took off in search of a solution that will allow me to create 3D elements in my applications using already known technologies such as QML. In ScytheStudio we can easily deepen our knowledge in the area that interests us, what is more, we gain not only time for development but also resources.
Fortunately, there is such thing as Qt Quick 3D, which provides us with an easy high-level API for creating elements in 3D using familiar QML language. It also covers areas like animations, cameras, lightning or materials. The goal of QtQuick 3D is to provide tools for programmers without in-depth knowledge of complex computer graphics.
A solution that doesn’t flood you with complicated mathematical formulas right at the start and fits my technology stack perfectly caught my attention right from the bat.
I eagerly started by going through the documentation and watching video tutorials. After a short introduction to the world of Qt Quick 3D, I decided to start a simple project. The first thing I had to do was downloading the Qt3D module through the maintenance tool, as it is not included in the core module. After that, you just need to add an import statement in the QML file and voilà, you can start using Qt Quick 3D!
Below you can see my first program created using Qt Quick 3D. The lack of fluidity is due to the necessary compression of the GIF file.
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 import QtQuick3D 1.15 import QtQuick3D.Materials 1.15 import QtQuick3D.Helpers 1.15 Window { id: root width: 640 height: 960 visible: true title: qsTr("QML 3D") View3D { id: view anchors.fill: parent environment: SceneEnvironment { clearColor: "#112220" backgroundMode: SceneEnvironment.Color } Node { id: scene PerspectiveCamera { id: camera z: 300 } DirectionalLight { z: 400 brightness: 100 } Model { source: "#Cube" materials: DefaultMaterial { diffuseColor: "green" } PropertyAnimation on eulerRotation.x { loops: Animation.Infinite duration: 5000 to: 360 from: 0 } PropertyAnimation on eulerRotation.y { loops: Animation.Infinite duration: 5000 to: 360 from: 0 } } } } }
It may not look spectacular, but for 30 minutes of work, I’m proud of the results 😉
At the beginning of the project, you can see the initialization of a standard Window item. Next in the hierarchy is the View3D object. This is, so to speak, the root object for all 3D elements. I replaced the default environment attribute with a custom SceneEnviorment, with a custom background colour.
Next, you can see an object of the Node type, i.e. a class from which all Qt Quick 3D elements derive. In its body, I placed 3 elements: PerspectiveCamera, DirectionalLight and Model. Let’s analyse them one by one:
PerspectiveCamera provides us with a “view” of the entire scene. It is an eye through which we observe the scene.
DirectionalLight illuminates our whole scene. It is important not to forget about this element because without light most objects will be black (humans perceive colours because the light that bounces off materials is making us see colours).
Model is a physical object that we create. In this example, I used the built-in cube object and the default material which I changed to green. In order to make the cube move, I added two animations that change the rotation of the cube along the X and Y-axis.
As we covered the basics, it’s time for something more difficult. Reading the documentation I found out that Qt Quick 3D supports using models created in applications like Blender, Maya or 3ds max. To import such a model, we need to convert them to QML code first. You can check our blog post about writing clean QML code. To do that we will use the built-in Balsam Asset Import Tool (It is located in the path: Qt/Tools/QtDesignStudio-XXX/qt5_design_studio_reduced_version where XXX is your actual QtDesignStudio version code). To demonstrate how this works, I created a simple “house” model in Blender.
Blender is a free solution with which anyone can become an architect
As we now have a model we can use the previously mentioned Balsam. After running it we get a .qml file that is able to be used in our program. A command for running it looks as follows:
balsam [options] source_file_name
Our “house” after conversion to QML
I decided it was time to gather all the knowledge and create something more interesting.
The first thing was to add a sphere object to imitate the sun. To do this I used a Model object with source set to #Sphere and yellow colour. Inside it, I added the PointLight item which was responsible for the sun rays.
Next, I added a side menu allowing me to rotate the “house” on all axes, move the sun model, change the strength of its light, and two switches allowing me to turn off the scene light and the sun.
In order to add more interactivity to the application, I used the WasdController allowing me to move around the scene using the keys on my keyboard.
Home, sweet home
I must admit I was very positively surprised by Qt Quick 3D. As a person without any experience in 3D graphics, I was able to understand its mechanics and use it for my needs. The extensive documentation was helpful here, including examples and sample codes.
Moreover, the set-up itself was straightforward. All you had to do was download the appropriate library using the Qt maintenance tool and use it in your project. Everything you need in one place. There was no need to reconfigure the whole project or complicated attaching of files.
The thing that captivated me most was the simplicity. The high level of abstraction makes it easy to combine 2D interface elements with 3D objects without having to change my way of thinking.
Of course, the examples presented in this article might not be very ambitious, but they are simple examples that allow feeling satisfied. I also encourage you to try your hand with Qt Quick 3D package. You will be surprised how easy and fun it is.
If you would like to read a similar article – feel free to email us with your ideas. Who knows, maybe your idea will inspire us to create another article? Take care and stay tuned 😉
Let's face it? It is a challenge to get top Qt QML developers on board. Help yourself and start the collaboration with Scythe Studio - real experts in Qt C++ framework.
Discover our capabilitiesI’m not going to lie, a lot of the projects we do at Scythe Studio are related to the medical […]
Trading software refers to the digital platforms and systems that enable investors and financial institutions to buy, sell, and manage […]
Verification and Validation (V&V) are two pillars that ensure a medical device is safe, effective, and compliant before it ever […]