[Interest] C++/QML Sequence Type to JavaScript Array
Jason H
jhihn at gmx.com
Thu Feb 18 17:25:21 CET 2016
> MyData object filled with some data and exposed as context property to QML. At QML i imported QtPositioning, so QGeoCoordinate refers to coordinate QML basic type, but
> console.log(myData.path) prints QVariant(QList<QGeoCoordinate>)
> console.log(myData.path) prints undefined
> - there is no sequence, no length.
>
> Is it possible to expose QList<Type> sequence to QML, where Type known by meta object system and refers to QML basic type provided by an QtQuick module?
> I know that i can expose C++ property of type QVariantList , but what is that opaque conversion mentioned in docs.
I think you want to convert them to a QList<QVariantMap> ? I do that and it works.
I don't know that I'm using the builr-in opaque conversion, but maybe that is just a matter of having a QVariantMap conversion?
More information about the Interest
mailing list