Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.3.2, 6.4.0
-
None
Description
Squish does some validation on properties when wrapping QObjects for access in test scripts. Typically, QObject property ids appear to be strictly monotonic, growing from QObject with every subclass's properties getting a unique id in the inheritance chain.
That doesn't seem to hold true for QtQuick classes derived from Qt3DCore::QEntity. Iterating the parent metaObjects and printing their propertyOffset and propertyCount - 1 (to get index ranges), I get this:
scene3d[12912]: Qt3DRender::QCamera: 3-23 scene3d[12912]: Qt3DCore::QEntity: 3-5 scene3d[12912]: Qt3DCore::QNode: 1-3 scene3d[12912]: QObject: 0-0
scene3d[12912]: Qt3DCore::Quick::Quick3DEntity: 5-10 scene3d[12912]: Qt3DCore::Quick::Quick3DNode: 3-7 scene3d[12912]: Qt3DCore::QEntity: 3-5 scene3d[12912]: Qt3DCore::QNode: 1-3 scene3d[12912]: QObject: 0-0
The Quick types are (afaik) registered as QML class extensions. They do not, in C++, inherit from QEntity but from QObject. QCamera however does inherit from QEntity so that doesn't seem to be the direct cause.
This function generated above output:
void printPropRanges( const QMetaObject *meta ) { Log::info( "%s: %i-%i", meta->className(), meta->propertyOffset(), meta->propertyOffset() + meta->propertyCount() - 1 ); if ( meta->superClass() ) { printPropRanges( meta->superClass() ); } }
We worked around this in Squish by wrapping all known entity and component classes explicitly on startup instead of lazily, which is a bit ugly.