Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.14.1
-
None
Description
A cuboid entity is created from the following QML:
Entity {
id: cuboid0
components: [
CuboidMesh
,
Transform
,
PhongMaterial
,
ObjectPicker
]
}
Similarily, a cuboid entity is created from C++:
auto cuboidEntity = new Qt3DCore::QEntity(rootEntity_);
cuboidEntity->setObjectName("Cuboid");
auto mat = new Qt3DExtras::QPhongMaterial(cuboidEntity);
mat->setDiffuse(QColor(217, 217, 255));
auto t = new Qt3DCore::QTransform(cuboidEntity);
auto mesh = new Qt3DExtras::QCuboidMesh(cuboidEntity);
auto picker = new Qt3DRender::QObjectPicker(cuboidEntity);
connect(picker, &Qt3DRender::QObjectPicker::clicked, [=]
);
mesh->setXExtent(1);
mesh->setYExtent(1);
mesh->setZExtent(1);
cuboidEntity->addComponent(mat);
cuboidEntity->addComponent(t);
cuboidEntity->addComponent(mesh);
cuboidEntity->addComponent(picker);
Note: entityClicked signal is connected to selectObject, which does:
for(var x in e)
console.log("dump:", x, e[x])
The result for the entity created from QML is different from the output for the entity created from C++:
created from QML:
qml: dump: Qt3DCore::Quick::Quick3DEntity(0x7f9f5d637520)
qml: dump: objectName
qml: dump: parent Qt3DCore::Quick::Quick3DEntity(0x7f9f5d62dad0)
qml: dump: enabled true
qml: dump: defaultPropertyTrackingMode 0
qml: dump: propertyTrackingOverrides undefined
qml: dump: data [object Object]
qml: dump: childNodes [object Object]
qml: dump: components [object Object]
qml: dump: objectNameChanged function()
qml: dump: parentChanged function() { [native code] }
qml: dump: enabledChanged function()
{ [native code] }qml: dump: defaultPropertyTrackingModeChanged function() { [native code] }
qml: dump: nodeDestroyed function()
{ [native code] }qml: dump: setParent function() { [native code] }
qml: dump: setEnabled function()
{ [native code] }qml: dump: setDefaultPropertyTrackingMode function() { [native code] }
qml: dump: propertyTrackingOverridesChanged function()
{ [native code] }QQmlExpression: Expression qrc:/test.qml:44:13 depends on non-NOTIFYable properties:
Qt3DCore::Quick::Quick3DEntity::data
Qt3DCore::Quick::Quick3DEntity::data
Qt3DCore::Quick::Quick3DEntity::childNodes
Qt3DCore::Quick::Quick3DEntity::childNodes
Qt3DCore::Quick::Quick3DEntity::components
Qt3DCore::Quick::Quick3DEntity::components
created from C++
qml: dump: Qt3DCore::QEntity(0x7f9f5f7abb60, "Cuboid")
qml: dump: objectName Cuboid
qml: dump: parent Qt3DCore::Quick::Quick3DEntity(0x7f9f5d62dad0)
qml: dump: enabled true
qml: dump: defaultPropertyTrackingMode 0
qml: dump: objectNameChanged function() { [native code] }
qml: dump: parentChanged function()
{ [native code] }qml: dump: enabledChanged function() { [native code] }
qml: dump: defaultPropertyTrackingModeChanged function()
{ [native code] }qml: dump: nodeDestroyed function() { [native code] }
qml: dump: setParent function()
{ [native code] }qml: dump: setEnabled function() { [native code] }
qml: dump: setDefaultPropertyTrackingMode function()
{ [native code] }In particular, the entity created from C++ doesn't expose the 'data', 'childNodes', 'components' properties.
Also, possibly related, is the fact that we get this warning: "QQmlExpression: Expression qrc:/test.qml:44:13 depends on non-NOTIFYable properties" for the exact same 3 properties.
So it is not possible to inspect scene tree hierarchy and access aspect such as transform from JavaScript?
Which of the above is the intended behaviour and which is not?