From: dbv Date: Fri, 18 Sep 2015 14:27:33 +0000 (+0300) Subject: Bug #1001: Fatal error after activation part X-Git-Tag: V_1.4.0~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7c6a0ae6754d348280dde75a32afd2cb0282ff48;p=modules%2Fshaper.git Bug #1001: Fatal error after activation part --- diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index ac0283644..67f1bcf7a 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -1011,8 +1011,6 @@ void PartSet_Module::processEvent(const std::shared_ptr& theMess } } #else - // Problem with MPV: At first time on creation it doesn't work because Part feature - // creation event will be sent after if (aActivePartIndex.isValid()) aTreeView->setExpanded(aActivePartIndex, false); XGUI_DataModel* aDataModel = aWorkshop->objectBrowser()->dataModel(); @@ -1026,8 +1024,14 @@ void PartSet_Module::processEvent(const std::shared_ptr& theMess // Update displayed objects in order to update active color XGUI_Displayer* aDisplayer = aWorkshop->displayer(); QObjectPtrList aObjects = aDisplayer->displayedObjects(); - foreach(ObjectPtr aObj, aObjects) - aDisplayer->redisplay(aObj, false); + bool aHidden; + foreach(ObjectPtr aObj, aObjects) { + //TODO: replace by redisplay event. + aHidden = !aObj->data() || !aObj->data()->isValid() || + aObj->isDisabled() || (!aObj->isDisplayed()); + if (!aHidden) + aDisplayer->redisplay(aObj, false); + } aDisplayer->updateViewer(); } }