TechDraw: Fix balloon annotation unlinked after undo-redo (#22805)

* TechDraw: remove then add balloon annotation when changing the SourceView

* Use fixSceneDependencies
This commit is contained in:
theo-vt
2025-08-18 11:37:02 -04:00
committed by GitHub
parent c15cfd6615
commit 10ae4de2f2
3 changed files with 13 additions and 4 deletions

View File

@@ -48,6 +48,7 @@
#include "QGIViewBalloon.h"
#include "TaskBalloon.h"
#include "ViewProviderBalloon.h"
#include "ViewProviderPage.h"
using namespace TechDrawGui;
using namespace TechDraw;
@@ -115,12 +116,18 @@ void ViewProviderBalloon::updateData(const App::Property* prop)
//Balloon handles X, Y updates differently that other QGIView
//call QGIViewBalloon::updateView
if (prop == &(getViewObject()->X) ||
prop == &(getViewObject()->Y) ){
prop == &(getViewObject()->Y)){
QGIView* qgiv = getQView();
if (qgiv) {
qgiv->updateView(true);
}
}
if (prop == &(getViewObject()->SourceView)) {
// Ensure the QGraphicsItems hierarchy matches the DocumentObject's
if (ViewProviderPage* vpp = getViewProviderPage()) {
vpp->fixSceneDependencies();
}
}
//Skip QGIView X, Y processing - do not call ViewProviderDrawingView
Gui::ViewProviderDocumentObject::updateData(prop);