From 7c6a0ae6754d348280dde75a32afd2cb0282ff48 Mon Sep 17 00:00:00 2001 From: dbv Date: Fri, 18 Sep 2015 17:27:33 +0300 Subject: [PATCH] Bug #1001: Fatal error after activation part --- src/PartSet/PartSet_Module.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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(); } } -- 2.39.2