Qt 3D overview
Before we see Qt 3D in action, let's go through the important parts of its architecture.
Entities and components
Qt 3D is not just a 3D rendering tool. When sufficiently evolved, it can become a full-featured game engine. This is supported by its original architecture. Qt 3D introduces a new set of abstractions that are particularly useful for its task.
You may have noticed that most of the Qt API heavily uses inheritance. For example, each widget type is derived from QWidget
, which in turn is derived from QObject
. Qt forms large family trees of classes to provide common and specialized behavior. In contrast, elements of a Qt 3D scene are constructed using composition instead of inheritance. A single part of a Qt 3D scene is called an entity and represented by the Entity
type. However, an Entity
object by itself doesn't have any particular effect or behavior. You can add pieces of behavior to an entity in the form of components.
Each component controls some part of the entity...