QJsonObject to QString
Created: 2023-06-22 11:50 #cpp #qt #json
With the following snippets you can convert a QJsonObject into a QString.
First convert the QJsonObject to a QJsonDocument. Then output the document as a QByteArray (the toJson method) and feed that to the QString init.
QJsonDocument doc(QJsonObject json); QString jsonString(doc.toJson()); References