From 495ae5df755a9a18448149936d5d28e6d6a4685f Mon Sep 17 00:00:00 2001 From: wandererfan Date: Thu, 7 Sep 2023 20:35:00 -0400 Subject: [PATCH] [Part]correct handling of preselected objects --- src/Mod/Part/Gui/DlgScale.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/Part/Gui/DlgScale.cpp b/src/Mod/Part/Gui/DlgScale.cpp index 05fbdf1aa5..03db951346 100644 --- a/src/Mod/Part/Gui/DlgScale.cpp +++ b/src/Mod/Part/Gui/DlgScale.cpp @@ -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");