[Part]correct handling of preselected objects

This commit is contained in:
wandererfan
2023-09-07 20:35:00 -04:00
committed by wwmayer
parent 22971a05dc
commit 495ae5df75

View File

@@ -68,6 +68,12 @@ DlgScale::DlgScale(QWidget* parent, Qt::WindowFlags fl)
ui->dsbYScale->setDecimals(Base::UnitsApi::getDecimals());
ui->dsbZScale->setDecimals(Base::UnitsApi::getDecimals());
findShapes();
// this will mark as selected all the items in treeWidget that are selected in the document
Gui::ItemViewSelection sel(ui->treeWidget);
sel.applyFrom(Gui::Selection().getObjectsOfType(Part::Feature::getClassTypeId()));
sel.applyFrom(Gui::Selection().getObjectsOfType(App::Link::getClassTypeId()));
sel.applyFrom(Gui::Selection().getObjectsOfType(App::Part::getClassTypeId()));
}
void DlgScale::setupConnections()
@@ -111,6 +117,8 @@ App::DocumentObject& DlgScale::getShapeToScale() const
return *(objs[0]);
}
//! find all the scalable objects in the active document and load them into the
//! list widget
void DlgScale::findShapes()
{
// Base::Console().Message("DS::findShapes()\n");