QJSValue instead of QVariantMap when passing javascript object from QML to C++
-
Dear
In QML, I have:
onClicked : { var data = {} // javascript object // code to fill the data object // the setData function is to QAbstractItemModel::setData __root.model.setData(currentIndex,data,SparkplugTreeModel.Value); }
In C++ I get a QVariant which is automatically converted but type is "QMetaType::User". The value I got from QML has type "QJSValue".
Why is this automagically converted to QJSValue and not to QVariantMap as expected?
Thanks
Pieter