Details
-
Bug
-
Resolution: Done
-
P2: Important
-
6.4.0
-
91c6d45559 (qt/qtdeclarative/dev) 91c6d45559 (qt/tqtc-qtdeclarative/dev)
Description
Qt 6.4.0 added support for property list<T> (see https://doc.qt.io/qt-6/qml-list.html#using-the-list-type ) but the corresponding type annotations are not supported.
Code
import QtQuick Window { width: 640 height: 480 visible: true property list<int> intList: [1, 2, 3, 4] function printList(arr: list<int>) { console.log(`Array of ${arr.length} items: [${arr}]`) } Component.onCompleted: printList(intList) }
Compile Output
Error: main.qml:10:5: Could not compile function printList: Cannot resolve the argument type list. function printList(arr: list<int>) { ^^^^^^^^^ Error: main.qml:14:28: Could not compile binding for onCompleted: type list for argument 0 cannot be resolved Component.onCompleted: printList(intList) ^^^^^^^^^
Attachments
Issue Links
- is required for
-
QTBUG-107633 qmlcompiler: recognize QList<T> as signal parameters
- Closed
- resulted in
-
QTBUG-108181 Support for calling methods with lists of objects as arguments is spotty
- Open
-
QTBUG-107773 list types are inconsistent
- Closed