Merge pull request #19941 from WandererFan/PropertiesAndSpinBoxes

[TD]Properties and spin boxes
This commit is contained in:
Chris Hennes
2025-03-10 16:55:13 +00:00
committed by GitHub
11 changed files with 342 additions and 223 deletions

View File

@@ -1042,6 +1042,7 @@ bool DrawViewPart::hasGeometry() const
const std::vector<TechDraw::VertexPtr>& verts = getVertexGeometry();
const std::vector<TechDraw::BaseGeomPtr>& edges = getEdgeGeometry();
return !(verts.empty() && edges.empty());
}
@@ -1469,6 +1470,33 @@ void DrawViewPart::resetReferenceVerts()
addReferencesToGeom();
}
void DrawViewPart::handleChangedPropertyType(Base::XMLReader &reader, const char * TypeName, App::Property * prop)
{
if (prop == &Direction) {
// Direction was PropertyVector but is now PropertyDirection
App::PropertyVector tmp;
if (strcmp(tmp.getTypeId().getName(), TypeName)==0) {
tmp.setContainer(this);
tmp.Restore(reader);
auto tmpValue = tmp.getValue();
Direction.setValue(tmpValue);
}
return;
}
if (prop == &XDirection) {
// XDirection was PropertyFloat but is now PropertyLength
App::PropertyVector tmp;
if (strcmp(tmp.getTypeId().getName(), TypeName)==0) {
tmp.setContainer(this);
tmp.Restore(reader);
auto tmpValue = tmp.getValue();
XDirection.setValue(tmpValue);
}
return;
}
}
// debugging ----------------------------------------------------------------------------
void DrawViewPart::dumpVerts(std::string text)