Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.4.1
-
32a9015c8 (dev), e7bfadb78 (6.5), 362c3f6e9 (6.4)
Description
Consider:
#include <qqml.h> class CppObj : public QObject { Q_OBJECT QML_ELEMENT QML_SINGLETON Q_PROPERTY(QVariantList varList READ varList NOTIFY varListChanged) public: explicit CppObj(QObject *parent = nullptr) : QObject(parent) {} QVariantList varList() const { return {1.1, 2.2, 3.3}; } signals: void varListChanged(); };
import QtQuick import QtQuick.Shapes import MyTest Window { width: 640 height: 480 visible: true ShapePath { id: path dashPattern: CppObj.varList } Component.onCompleted: { console.log("Source list:", CppObj.varList) console.log("Target list:", path.dashPattern) } }
This works in 6.3 and earlier, but breaks in 6.4. The error message is:
qrc:/MyTest/main.qml:12:3: Unable to assign QVariantList to QList<double>
Attachments
For Gerrit Dashboard: QTBUG-109584 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
450280,4 | QML: Re-allow assigning QVariantList to arbitrary other lists | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
451968,2 | QML: Re-allow assigning QVariantList to arbitrary other lists | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
451969,2 | QML: Re-allow assigning QVariantList to arbitrary other lists | 6.4 | qt/qtdeclarative | Status: MERGED | +2 | 0 |