From: vsv Date: Thu, 10 Sep 2015 14:40:59 +0000 (+0300) Subject: Issue #937: Process update of objects in Object Browser X-Git-Tag: V_1.4.0_beta4~33^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=90a0be0a74929e91728e57c27413b18a7eacef12;p=modules%2Fshaper.git Issue #937: Process update of objects in Object Browser --- diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index a8fa72080..c6ccd9e92 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -65,6 +65,7 @@ XGUI_DataModel::XGUI_DataModel(QObject* theParent) : ModuleBase_IDocumentDataMod Events_Loop* aLoop = Events_Loop::loop(); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_CREATED)); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_DELETED)); + aLoop->registerListener(this, Events_Loop::eventByName(EVENT_OBJECT_UPDATED)); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_ORDER_UPDATED)); aLoop->registerListener(this, Events_Loop::eventByName(EVENT_DOCUMENT_CHANGED)); } @@ -207,6 +208,19 @@ void XGUI_DataModel::processEvent(const std::shared_ptr& theMess #endif } } + } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_OBJECT_UPDATED)) { + std::shared_ptr aUpdMsg = + std::dynamic_pointer_cast(theMessage); + std::set aObjects = aUpdMsg->objects(); + + std::set::const_iterator aIt; + std::string aObjType; + for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) { + ObjectPtr aObject = (*aIt); + QModelIndex aIndex = objectIndex(aObject); + if (aIndex.isValid()) + emit dataChanged(aIndex, aIndex); + } } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_ORDER_UPDATED)) { std::shared_ptr aUpdMsg = std::dynamic_pointer_cast(theMessage);