Details
-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
5.7.0 RC
-
None
-
Linux 64bit, nVidia GTX970
Description
When looking up for QML references by 'objectName' from C++ code, the returned pointer is always NULL. For example:
QQuickItem *scene3D = qobject_cast<QQuickItem*>(rootObject()->findChild<QObject *>("scene3DItem")); QEntity *sceneEntity = qobject_cast<QEntity *>(scene3D->findChild<QObject *>("sceneRootEntity"));
This prevents any interaction between the QML and C++ world, thus it is not possible to manipulate a QML scene at runtime.
This happens either at startup when Component.onCompleted of scene3D is fired, or at runtime when calling a Q_INVOKABLE from QML asynchronously.
Please see attached examples:
- dynamic-scene-5.7.tar.gz exposes the plain issue
- dynamic-scene-cpp-qml-workaround.tar.gz tries to workaround the issue by passing QML references to the C++ invokable. This was working up to 3 days ago. As of today, it segfaults when requesting a scene re-render