-#ifdef ModuleDataModel
- QModelIndex aOldIndex = myDataModel->activePartTree();
- DocumentPtr aDoc = aMgr->moduleDocument();
- if (aActiveDoc == aDoc) {
- if (aOldIndex.isValid())
- aTreeView->setExpanded(aOldIndex, false);
- myDataModel->deactivatePart();
- aPalet.setColor(QPalette::Text, QColor(0, 72, 140));
- } else {
- std::string aGrpName = ModelAPI_ResultPart::group();
- for (int i = 0; i < aDoc->size(aGrpName); i++) {
- ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aDoc->object(aGrpName, i));
- if (aPart->partDoc() == aActiveDoc) {
- QModelIndex aIndex = myDataModel->partIndex(aPart);
- if (myDataModel->activatePart(aIndex)) {
- if (aOldIndex.isValid())
- aTreeView->setExpanded(aOldIndex, false);
- aTreeView->setExpanded(myDataModel->activePartTree(), true);
- aPalet.setColor(QPalette::Text, Qt::black);
- }
- break;
- }
- }
- }
-#else
- // Problem with MPV: At first time on creation it doesn't work because Part feature
- // creation event will be sent after