Qt Quick 3D 提供用於創建 3D 內容和 3D 用戶界麵的高級 API,基於 Qt Quick . Rather than using an external engine, which creates syncing issues and additional layers of abstraction, Qt Quick 3D provides extensions to the existing Qt Quick 場景圖形 for spatial content and a renderer for that extended scene graph. When using the spatial scene graph, it's possible to mix Qt Quick 2D content with 3D content.
The QML types of the module are available through the
QtQuick3D
導入。要使用類型,添加以下 import 語句到 .qml 文件:
import QtQuick3D
The following module imports provide additional functionality:
import QtQuick3D.AssetUtils import QtQuick3D.Helpers import QtQuick3D.Particles3D
Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake .
使用
find_package()
command to locate the needed module component in the
Qt6
包:
find_package(Qt6 REQUIRED COMPONENTS Quick3D)
target_link_libraries(mytarget PRIVATE Qt6::Quick3D)
更多細節,見 構建采用 CMake 概述。
To configure the module for building with qmake, add the module as a value of the
QT
variable in the project's .pro file:
QT += quick3d
When building from source, ensure that the modules and tools from the qtdeclarative and qtshadertools repositories are built first, as it's not possible to use Qt Quick 3D without these. Having qtquicktimeline available is strongly recommended as well, since keyframe-based animations will not be available otherwise.
In addition, some of the examples rely on Qt Quick Controls .
Changes to Qt Quick 3D lists important changes in the module API and functionality that were done for the Qt 6 series of Qt.
Qt Quick 3D 在商業許可下是可用的來自 Qt 公司 。此外,它是可用的根據 GNU GPL (一般公共許可) 第 3 版 。見 Qt 許可 進一步瞭解細節。
Furthermore, Qt Quick 3D potentially contains third party modules under the following permissive licenses:
| Godot Engine: Fog | MIT 許可 |
| Intel Embree, version 3.13.3 | Apache 許可 2.0 |
| Open Asset Import Library, version 5.2.5 | BSD 3 條款新 (或修訂) 許可 |
| ProceduralSky | MIT 許可 |
| Tiny OpenEXR, version v1.0.2 | BSD 3 條款新 (或修訂) 許可 |
| meshoptimizer, version v0.18 | MIT 許可 |
| xatlas, version 16ace528acd2cf1f16a7c0dde99c42c486488dbe | MIT 許可 |