|
|
@ -1,9 +1,10 @@ |
|
|
|
#include <QJsonArray> |
|
|
|
#include <QJsonObject> |
|
|
|
#include <QJsonDocument> |
|
|
|
#include <QDebug> |
|
|
|
|
|
|
|
#include "viewModel/markerMode/MarkerModeViewModel.h" |
|
|
|
#include "viewModel/UsmMimic.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SINGLETON_DEF(MarkerModeViewModel) |
|
|
@ -13,17 +14,27 @@ MarkerModeViewModel::MarkerModeViewModel() |
|
|
|
} |
|
|
|
void MarkerModeViewModel::init() |
|
|
|
{ |
|
|
|
QJsonArray jsonArray; |
|
|
|
//==================BodyMark================
|
|
|
|
QJsonObject mainObj; |
|
|
|
|
|
|
|
QJsonObject jsonObjectLeg; |
|
|
|
QJsonArray jsonArrayLeg = {"foot1","foot2","foot3"}; |
|
|
|
jsonObjectLeg.insert ("Leg",jsonArrayLeg); |
|
|
|
mainObj.insert ("Leg",jsonArrayLeg); |
|
|
|
QJsonArray jsonArrayHand = {"Hand1","Hand2","Hand3","Hand4"}; |
|
|
|
mainObj.insert ("Hand",jsonArrayHand); |
|
|
|
|
|
|
|
jsonArray.append (jsonObjectLeg); |
|
|
|
QJsonDocument jsonDoc; |
|
|
|
jsonDoc.setArray(jsonArray); |
|
|
|
jsonDoc.setObject (mainObj); |
|
|
|
QString answer = jsonDoc.toJson(); |
|
|
|
BodyMarkJson (answer); |
|
|
|
|
|
|
|
//==============BodyParts=====================
|
|
|
|
BodyPartJson (answer); |
|
|
|
|
|
|
|
//================================
|
|
|
|
connect (this,&MarkerModeViewModel::BodyMarkChanged,[=](){ |
|
|
|
qDebug() << this->BodyMark() << "k"; |
|
|
|
}); |
|
|
|
qDebug() << "Hi"; |
|
|
|
} |
|
|
|
void MarkerModeViewModel::setInitialValue() |
|
|
|
{ |
|
|
|