Important: Please read the Qt Code of Conduct -

How To pass QJsonArray Data to Qml

  • QJsonArray   m_DataSourceArray = m_DataSourceObject.value(QString("camera")).toArray();


    how to display this data in Qml?


  • Moderators

    You can send QJsonArray as QVariantList and on QML side it is automatically converted to JS array. Same for JSON objects, they become JS objects.

    So you can just send this array to QML via whatever mechanism you are using, store it in a property var and then use that variable to display your data in UI.

  • @sierdzio : Thanks

Log in to reply