Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.6, 6.5, 6.6.3, 6.7.0 Beta3, 6.8.0 FF
-
6.5.4
-
None
-
e303d1282 (dev), 411f6cce0 (6.7), 7d3204ff0 (6.6), dd865c1a6 (tqtc/lts-6.5)
Description
I have a Q_INVOKABLE method that returns QList<int>. The method does work in cpp but when called from QML/JS
var list = listProvider.intList()
console.log(list)
this gives me '0'
But if I do:
console.log(list, list.length)
it gives me '[0,1,2,3,4] 5'
So it means that when qmlsc is unable to compile the js function (because of using the length property of the array) it works properly but when qmlsc does compile the function it missunderstand the QList<int> return type
And apparently, it seems to work when using QList<int> with Q_PROPERTY
See the attached project to test yourself