QJSValue instead of QVariantMap when passing javascript object from QML to C++
Unsolved
QML and Qt Quick
-
wrote on 1 Feb 2023, 11:18 last edited by
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
1/1