diff --git a/logic/include/viewModel/markerMode/MarkerModeViewModel.h b/logic/include/viewModel/markerMode/MarkerModeViewModel.h index 0029d7d..fea30da 100644 --- a/logic/include/viewModel/markerMode/MarkerModeViewModel.h +++ b/logic/include/viewModel/markerMode/MarkerModeViewModel.h @@ -29,8 +29,10 @@ class MarkerModeViewModel : public BaseViewModel //=======JoySticks======= - //=======Pointer======= - US_JSON(BodyMark,"a",1) + + + US_JSON(BodyMark,"a","") + US_JSON(BodyPart,"","") }; diff --git a/logic/include/viewModel/utils/UsJson.h b/logic/include/viewModel/utils/UsJson.h index 3f92e39..740bbcb 100644 --- a/logic/include/viewModel/utils/UsJson.h +++ b/logic/include/viewModel/utils/UsJson.h @@ -5,7 +5,7 @@ #define US_JSON(NAME, \ JSON, \ VALUE) \ - US_PROPERTY(int, NAME, VALUE) \ + US_PROPERTY(QString, NAME, VALUE) \ US_PROPERTY(QString, NAME ## Json, JSON) #endif // USJSON_H diff --git a/logic/src/viewModel/markerMode/MarkerModeViewModel.cpp b/logic/src/viewModel/markerMode/MarkerModeViewModel.cpp index c55675a..533a335 100644 --- a/logic/src/viewModel/markerMode/MarkerModeViewModel.cpp +++ b/logic/src/viewModel/markerMode/MarkerModeViewModel.cpp @@ -1,9 +1,10 @@ #include #include #include +#include #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() { diff --git a/ui b/ui index 50fec2e..e065d81 160000 --- a/ui +++ b/ui @@ -1 +1 @@ -Subproject commit 50fec2e3c8ce4837165dc7f1be2ead148614596a +Subproject commit e065d81a2ef2c17a3879badb16a90108327461be