PDA

View Full Version : converting qml json object to c++ QJsonObject



rajko
30th September 2013, 19:47
Hi, I read the link

http://qt-project.org/doc/qt-5.1/qtqml/qtqml-cppintegration-interactqmlfromcpp.html

and the last example on page seem to me the right way to send var json object via signal argument from qml, instead QVariant I used QvariantMap but i get massage:
No such signal QQuickRectangle_QML_45::btnSaveClicked(QVariantMap )

and is this the right way to cast from QvariantMap to QJsonObject?



void Partneri::btnSaveClicked(const QVariantMap& v)
{
QJsonObject jsp = QJsonObject::fromVariantMap(v);

qDebug() << jsp.keys();

}

Thanks.