#include "bridge.h" #include #include #include #include #include Bridge::Bridge(QObject *parent) : QObject{parent} { QJsonDocument jsonDoc; QJsonArray mainArray; QJsonObject obj1; obj1.insert ("source","source1"); obj1.insert ("destination","destination1"); obj1.insert ("message","message1"); obj1.insert ("duration","duration1"); QJsonArray childArray; childArray.append (obj1); childArray.append (obj1); obj1.insert ("child",childArray); mainArray.append (obj1); mainArray.append (obj1); jsonDoc.setArray (mainArray); QString jsonString = jsonDoc.toJson(); connect (this,&Bridge::sortsChanged ,[=](int path,int path1,int path2, int path3){ qDebug() << "___________--"; qDebug() << path << " " << path1; }); QTimer::singleShot(2000, this, [=](){ emit setJsonData (jsonString); }); }