+ else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY)) {
+ std::shared_ptr<ModelAPI_ObjectUpdatedMessage> aUpdMsg =
+ std::dynamic_pointer_cast<ModelAPI_ObjectUpdatedMessage>(theMessage);
+ std::set<ObjectPtr> aObjects = aUpdMsg->objects();
+
+ QObjectPtrList aCreated;
+ std::set<ObjectPtr>::const_iterator aIt;
+ bool aRebuildAll = false;
+ for (aIt = aObjects.cbegin(); aIt != aObjects.cend(); aIt++) {
+ ObjectPtr aObj = (*aIt);
+ if (aObj->groupName() == ModelAPI_ResultField::group()) {
+ aCreated.append(aObj);
+ }
+ }
+ foreach(ObjectPtr aObj, aCreated) {
+ ModuleBase_ITreeNode* aNode = myRoot->subNode(aObj);
+ if (aNode) {
+ int aOldNb = aNode->childrenCount();
+ aNode->update();
+ int aNewNb = aNode->childrenCount();
+
+ QModelIndex aFirstIdx = getIndex(aNode, 0);
+ QModelIndex aLastIdx = getIndex(aNode, 2);
+
+ if (aNewNb > aOldNb) {
+ insertRows(aOldNb - 1, aNewNb - aOldNb, aFirstIdx);
+ }
+ else if (aNewNb < aOldNb) {
+ removeRows(aNewNb - 1, aOldNb - aNewNb, aFirstIdx);
+ }
+ dataChanged(aFirstIdx, aLastIdx);
+ }
+ }
+ }