Details
Description
Consider:
import QtQml QtObject { property list<QtObject> objs: [ QtObject {}, QtObject {} ] function returnObjs() : list<QtObject> { objs.push(this); // do something we cannot compile to C++ return objs } Component.onCompleted: { var local = returnObjs(); console.log(local[0], local[1], local[2]); } }
This crashes when compiled to C++. The onCompleted handler is compiled to C++ and the returnObjs() function is not. However, the engine cannot properly convert QQmlListProperty to itself and returns a default-constructed list property there. The default-constructed list property does not have an at() method, which we assume to be available in generated code.