Merge pull request #14388 from Ondsel-Development/core_rootObjects

Core: Add Gui::Document::getTreeRootObjects() Fixes #14373
This commit is contained in:
Chris Hennes
2024-06-17 11:04:18 -05:00
committed by GitHub
10 changed files with 122 additions and 4 deletions

View File

@@ -2758,7 +2758,8 @@ void TreeWidget::sortDroppedObjects(TargetItemInfo& targetInfo, std::vector<App:
propGroup->setValue(sortedObjList);
}
else if (targetInfo.targetItem->type() == TreeWidget::DocumentType) {
objList = targetInfo.targetDoc->getRootObjectsIgnoreLinks();
Gui::Document* guiDoc = Gui::Application::Instance->getDocument(targetInfo.targetDoc->getName());
objList = guiDoc->getTreeRootObjects();
// First we need to sort objList by treeRank.
std::sort(objList.begin(), objList.end(),
[](App::DocumentObject* a, App::DocumentObject* b) {