Passing an Array of Objects from QML to C++
-
Hi,
given the following QML expression:
property int value: 0 filters: [ { type: value1 } ]how can I implement the "filters" property in C++:
Q_PROPERTY(... filters ...)?
-
Wow, that was quick! ;-)
Ok, what should the type of QQmlListProperty be?
Q_PROPERTY(QQmlListProperty<...> filters READ filters)@DuBu said in Passing an Array of Objects from QML to C++:
Wow, that was quick! ;-)
yes too quick. my suggestion was for QObject derived objects.
For your case a QVariantList should be enough? Where the contained QVariants will be of type QVariantMap when they come from QML.