Gui: bind spin boxes of Placement dialog when opening it via menu
This commit is contained in:
@@ -1498,8 +1498,19 @@ void StdCmdPlacement::activated(int iMsg)
|
||||
auto plm = new Gui::Dialog::TaskPlacement();
|
||||
if (!sel.empty()) {
|
||||
App::Property* prop = sel.front()->getPropertyByName("Placement");
|
||||
if (prop && prop->getTypeId() == App::PropertyPlacement::getClassTypeId())
|
||||
if (prop && prop->getTypeId() == App::PropertyPlacement::getClassTypeId()) {
|
||||
plm->setPlacement(static_cast<App::PropertyPlacement*>(prop)->getValue());
|
||||
|
||||
std::vector<Gui::SelectionObject> selection;
|
||||
selection.reserve(sel.size());
|
||||
std::transform(sel.cbegin(), sel.cend(), std::back_inserter(selection), [](App::DocumentObject* obj) {
|
||||
return Gui::SelectionObject(obj);
|
||||
});
|
||||
|
||||
plm->setPropertyName(QLatin1String("Placement"));
|
||||
plm->setSelection(selection);
|
||||
plm->bindObject();
|
||||
}
|
||||
}
|
||||
Gui::Control().showDialog(plm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user