[TechDraw] Reimplement Rich Annotation parent linking

This commit is contained in:
pavltom
2024-02-15 17:06:21 +01:00
committed by WandererFan
parent 0c09c6257c
commit d11d3cd7b8
18 changed files with 136 additions and 194 deletions

View File

@@ -61,28 +61,6 @@ DrawViewSymbol::DrawViewSymbol()
DrawViewSymbol::~DrawViewSymbol() {}
void DrawViewSymbol::touchTreeOwner()
{
auto owner = dynamic_cast<DrawView *>(Owner.getValue());
if (owner) {
owner->touch();
}
else { // If no owner is specified, touch all parent pages
for (auto page : findAllParentPages()) {
page->touch();
}
}
}
void DrawViewSymbol::onBeforeChange(const App::Property *prop)
{
if (prop == &Owner && !isRestoring()) {
touchTreeOwner();
}
TechDraw::DrawView::onBeforeChange(prop);
}
void DrawViewSymbol::onChanged(const App::Property* prop)
{
if (prop == &Symbol) {
@@ -97,11 +75,6 @@ void DrawViewSymbol::onChanged(const App::Property* prop)
//1 cycle
updateFieldsInSymbol();
}
else if (prop == &Owner) {
if (!isRestoring()) {
touchTreeOwner();
}
}
TechDraw::DrawView::onChanged(prop);
}
@@ -124,11 +97,6 @@ App::DocumentObjectExecReturn* DrawViewSymbol::execute()
return DrawView::execute();
}
DrawView *DrawViewSymbol::claimParent() const
{
return dynamic_cast<DrawView *>(Owner.getValue());
}
QRectF DrawViewSymbol::getRect() const
{
double w = 64.0;//must default to something