2

对于我的项目,我需要在 QtQuick.Component 中放置 QtQuick.Scene3D 场景已成功创建,但是当我尝试处理组件时,我在

0   Qt3D::QCamera::position() const 0xb7226e6b  
1   Qt3D::QCamera::translate(QVector3D const&, Qt3D::QCamera::CameraTranslationOption)  0xb7226fa4  

似乎以错误的顺序删除了对象。所以,有一个问题:我应该在 C++ 中实现整个对象图,还是有正确的方法让 Scene3D 可重新创建?

有我的组件 qml 文件:

import Qt3D 2.0
import Qt3D.Renderer 2.0
import QtQuick.Scene3D 2.0
import QtQuick 2.0 as QQ2
import CeGui 1.0;
import VectorPlot 1.0;

QQ2.Component {
    QQ2.Item {
        Scene3D {
            anchors.fill: parent
            id: rootscene
            aspects: "input"

            Entity {
                id: sceneRoot

                Camera {
                    id: camera
                    projectionType: CameraLens.PerspectiveProjection
                    fieldOfView: 45
                    aspectRatio: 16/9
                    nearPlane : 0.1
                    farPlane : 1000.0
                    position: Qt.vector3d( 25.0, -25.0, 25.0 )
                    upVector: Qt.vector3d( 0.0, 0.0, 1.0 )
                    viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
                }

                Configuration  {
                    id: cfg
                    controlledCamera: camera
                }

                Viewport {
                    id: viewport
                    rect: Qt.rect(0.0, 0.0, 1.0, 1.0) // From Top Left
                    clearColor: Qt.rgba(0, 0.5, 1, 1)

                    CameraSelector {
                        id : cameraSelector
                        camera: camera
                        ClearBuffer {
                            buffers : ClearBuffer.ColorDepthBuffer
                        }
                    }
                }

                components: [
                    FrameGraph {
                        id: framgraph
                        activeFrameGraph: viewport
                    }
                ]

                BarChartScene {
                    id: bcs
                    model: GlobalViewModel.harmonicsEditModel
                }
            }
        }
    }
}

我在 Linux 中将 Qt 5.5 用于 32 位 gcc

4

1 回答 1

3

似乎是已知的错误,将在即将发布的版本中修复

于 2015-09-02T08:56:37.533 回答