Qt Graphs 与Qt Quick 3D
由于Qt Graphs for 3D基于Qt Quick 3D ,因此可以将Qt Quick 3D 场景集成到图形中。

场景环境
要在图表中调整Qt Quick 3D 场景环境,请在图表的environment 属性中按以下方式定义SceneEnvironment 或ExtendedSceneEnvironment :
environment: ExtendedSceneEnvironment {
aoEnabled: true
aoDither: true
ditheringEnabled: true
lightProbe: Texture {
textureData: ProceduralSkyTextureData {
groundBottomColor: "black"
skyTopColor: "white"
}
}
backgroundMode: SceneEnvironment.SkyBox
lensFlareEnabled: true
lensFlareGhostCount: 10
lensFlareApplyStarburstTexture: true
lensFlareBloomBias: 0.4
}不支持的功能
覆盖抗锯齿模式或场景清屏颜色无效,这意味着为SceneEnvironment.antialiasingMode 和SceneEnvironment.clearColor 设置值不会产生任何效果。但是,如果backgroundMode 未设置为SceneEnvironment.Color ,背景将受这些设置的影响。
场景集成
要将Qt Quick 3D 场景集成到图表中,请将图表的importScene 属性设置为具有以下设置的Node :
importScene: Node {
Model {
scale: Qt.vector3d(0.01, 0.01, 0.01)
source: "#Sphere"
x: 2.5
z: 2
y: 1
castsReflections: false
receivesReflections: true
materials: [
PrincipledMaterial {
baseColor: "gold"
metalness: 1.0
roughness: 0.1
}
]
ReflectionProbe {
boxSize: Qt.vector3d(6, 3, 5)
boxOffset: Qt.vector3d(-1.5, -1, -1.5)
parallaxCorrection: true
quality: ReflectionProbe.High
}
}
Model {
scale: Qt.vector3d(0.01, 0.01, 0.01)
source: "#Sphere"
x: -2.5
z: -2
y: 1
castsReflections: false
receivesReflections: true
materials: [
PrincipledMaterial {
baseColor: "white"
metalness: 0.0
roughness: 0.0
transmissionFactor: 1.0
thicknessFactor: 50
}
]
}
}直接将Nodes 作为子元素添加到图中是行不通的,因为图的默认子元素是相应的系列。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.