}
}
#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();
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: SketcherPrs_Angle.h
+// Created: 26 March 2015
+// Author: Vitaly SMETANNIKOV
+
+
+#ifndef SketcherPrs_Angle_H
+#define SketcherPrs_Angle_H
+
+
+
+#endif
\ No newline at end of file
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_DOCUMENT_CHANGED));
}
//******************************************************
}
}
#ifdef _DEBUG
- else {
+ else
Events_Error::send("Problem with Data Model definition of sub-document");
- }
#endif
}
}
}
}
#ifdef _DEBUG
- else {
+ else
Events_Error::send("Problem with Data Model definition of sub-document");
- }
#endif
}
}
+ } else if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_DOCUMENT_CHANGED)) {
+ DocumentPtr aDoc = ModelAPI_Session::get()->activeDocument();
+ if (aDoc != aRootDoc) {
+ QModelIndex aDocRoot = findDocumentRootIndex(aDoc.get());
+ if (aDocRoot.isValid())
+ emit dataChanged(aDocRoot, aDocRoot);
+#ifdef _DEBUG
+ else
+ Events_Error::send("Problem with Data Model definition of sub-document");
+#endif
+ }
}
}
// Check for Part feature
ResultPartPtr aPartRes = getPartResult(aObj);
if (aPartRes.get())
- return true;
+ return aPartRes->partDoc().get() != NULL;
else {
// Check for composite object
ModelAPI_CompositeFeature* aCompFeature = dynamic_cast<ModelAPI_CompositeFeature*>(aObj);