-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.8.4
-
56292c205 (dev), 7fd690a94 (6.10), 751c79764 (6.9), 6a841f802 (6.8)
Consider:
Window { width: 640 height: 480 visible: true component MyObject : QtObject { property real someVal } // property list<QtObject> myList: // WORKS property list<MyObject> myList: // DOESN'T WORK [ MyObject { someVal: 3 }, MyObject { someVal: 4 } ] property real currentVal: myList[0].someVal }
When compiling this in direct mode, you get:
/home/qt/listtest/build/6_8-Debug/.rcc/qmlcache/applisttest_Main_qml.cpp: In lambda function: /home/qt/listtest/build/6_8-Debug/.rcc/qmlcache/applisttest_Main_qml.cpp:225:86: error: wrong number of template arguments (0, should be 1) 225 | aotContext->initLoadScopeObjectPropertyLookup(0, QMetaType::fromType<QQmlListProperty<>>()); | ^ In file included from /home/qt/qt6.8/qtbase/include/QtQml/qqmllist.h:1, from /home/qt/qt6.8-src/qtdeclarative/src/qml/qml/qqmlprivate.h:20, from /home/qt/qt6.8/qtbase/include/QtQml/qqmlprivate.h:1, from /home/qt/listtest/build/6_8-Debug/.rcc/qmlcache/applisttest_Main_qml.cpp:2: /home/qt/qt6.8-src/qtdeclarative/src/qml/qml/qqmllist.h:24:7: note: provided for ‘template<class T> class QQmlListProperty’ 24 | class QQmlListProperty { | ^~~~~~~~~~~~~~~~ /home/qt/listtest/build/6_8-Debug/.rcc/qmlcache/applisttest_Main_qml.cpp:225:89: error: no matching function for call to ‘QMetaType::fromType<<expression error> >()’ 225 | aotContext->initLoadScopeObjectPropertyLookup(0, QMetaType::fromType<QQmlListProperty<>>()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ In file included from /home/qt/qt6.8/qtbase/include/QtCore/qmetatype.h:1, from /home/qt/qt6.8-src/qtbase/src/corelib/kernel/qvariant.h:10, from /home/qt/qt6.8/qtbase/include/QtCore/qvariant.h:1, from /home/qt/qt6.8-src/qtdeclarative/src/qml/jsapi/qjsprimitivevalue.h:12, from /home/qt/qt6.8/qtbase/include/QtQml/qjsprimitivevalue.h:1, from /home/qt/qt6.8-src/qtdeclarative/src/qml/qml/qqmlprivate.h:18: /home/qt/qt6.8-src/qtbase/src/corelib/kernel/qmetatype.h:2647:21: note: candidate: ‘template<class T> static constexpr QMetaType QMetaType::fromType()’ 2647 | constexpr QMetaType QMetaType::fromType() | ^~~~~~~~~ /home/qt/qt6.8-src/qtbase/src/corelib/kernel/qmetatype.h:2647:21: note: template argument deduction/substitution failed: /home/qt/listtest/build/6_8-Debug/.rcc/qmlcache/applisttest_Main_qml.cpp:225:89: error: template argument 1 is invalid 225 | aotContext->initLoadScopeObjectPropertyLookup(0, QMetaType::fromType<QQmlListProperty<>>()); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
For Gerrit Dashboard: QTBUG-139431 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
670613,3 | Don't resolve composite list types with metaTypeFromType | dev | qt/tqtc-qmlcompilerplus | Status: MERGED | +2 | 0 |
670818,2 | Don't resolve composite list types with metaTypeFromType | 6.10 | qt/tqtc-qmlcompilerplus | Status: MERGED | +2 | 0 |
670867,2 | Don't resolve composite list types with metaTypeFromType | 6.9 | qt/tqtc-qmlcompilerplus | Status: MERGED | +2 | 0 |
670895,2 | Don't resolve composite list types with metaTypeFromType | 6.8 | qt/tqtc-qmlcompilerplus | Status: MERGED | +2 | 0 |