ensure document objects claims in tree
It is possible that a newly reated document object already claims other existing objects. The tree needs to be recomputed in this case. This happens for example for the origin, which creates its planes and axis first and claims them before its own viewprovider is created.
This commit is contained in:
@@ -908,6 +908,11 @@ void DocumentItem::slotNewObject(const Gui::ViewProviderDocumentObject& obj)
|
||||
item->setIcon(0, obj.getIcon());
|
||||
item->setText(0, QString::fromUtf8(displayName.c_str()));
|
||||
ObjectMap[objectName] = item;
|
||||
|
||||
// it may be possible that the new object claims already existing objects. If this is the
|
||||
// case we need to make sure this is shown by the tree
|
||||
if(!obj.claimChildren().empty())
|
||||
slotChangeObject(obj);
|
||||
}else {
|
||||
Base::Console().Warning("DocumentItem::slotNewObject: Cannot add view provider twice.\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user