Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.15.18, 6.5.8, 6.8.3, 6.9.0
-
Windows 10 22H2, MSVC 2022 x64
-
e37daba8c (dev), b050778c4 (6.9), daa24ca0c (tqtc/lts-6.8), 04696fe0f (tqtc/lts-6.5)
Description
Code
import QtQuick Window { width: 640 height: 480 visible: true ListModel { id: listModel } Component.onCompleted: { const rawObj = { innerList: [1, 2, 3] } listModel.append(rawObj) const convertedObj = listModel.get(0) console.log(rawObj.innerList) console.log(Object.values(rawObj.innerList)) // <-- OK console.log(convertedObj.innerList) console.log(Object.values(convertedObj.innerList)) // <-- Crashes } }
Notes
If we replace the JS array with a C++ QStringList...
const rawObj = { innerList: CppSingleton.qStringListProp }
...then it won't crash in Qt 6.5 because convertedObj.innerList is a JS object (as opposed to a QQmlListModel in Qt 6.8+)