From a537e340772ba93b50e2bc438eeb6d6fa3b44d96 Mon Sep 17 00:00:00 2001 From: wandererfan Date: Mon, 13 May 2019 11:32:34 -0400 Subject: [PATCH] Fix duplicate child claiming --- src/Mod/TechDraw/App/DrawRichAnno.cpp | 2 -- src/Mod/TechDraw/Gui/QGIRichAnno.cpp | 5 ++--- src/Mod/TechDraw/Gui/ViewProviderPage.cpp | 7 +++++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Mod/TechDraw/App/DrawRichAnno.cpp b/src/Mod/TechDraw/App/DrawRichAnno.cpp index 8799f74ed0..9840f9ff24 100644 --- a/src/Mod/TechDraw/App/DrawRichAnno.cpp +++ b/src/Mod/TechDraw/App/DrawRichAnno.cpp @@ -50,8 +50,6 @@ DrawRichAnno::DrawRichAnno(void) ADD_PROPERTY_TYPE(AnnoParent,(0),group,(App::PropertyType)(App::Prop_None), "Object to which this annontation is attached"); ADD_PROPERTY_TYPE(AnnoText, (""), group, App::Prop_None, "Anno text"); -// Base::Vector3d pos(0.0,0.0,0.0); -// ADD_PROPERTY_TYPE(TextPosition, (pos), group, App::Prop_None, "Anno position relative to parent"); ADD_PROPERTY_TYPE(ShowFrame, (true), group, App::Prop_None, "Outline rectangle on/off"); ADD_PROPERTY_TYPE(MaxWidth, (-1.0), group, App::Prop_None, "Width limit before auto wrap"); } diff --git a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp index 4031453a1a..02ff1ba528 100644 --- a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp +++ b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp @@ -96,7 +96,6 @@ QGIRichAnno::QGIRichAnno(QGraphicsItem* myParent, setZValue(ZVALUE::DIMENSION); -// we should be able to just drag QGIRA instead of m_text item?? QObject::connect( m_text, SIGNAL(dragging()), this , SLOT (textDragging()) @@ -126,7 +125,7 @@ QVariant QGIRichAnno::itemChange(GraphicsItemChange change, const QVariant &valu void QGIRichAnno::textDragging(void) { -// Base::Console().Message("QGIL::textDragging()\n"); +// Base::Console().Message("QGIRA::textDragging()\n"); //this is the long way around. can we do it without crossing the App/Gui boundary? //just update graphics until drag finished. // auto lead( dynamic_cast(getFeature()) ); @@ -146,7 +145,7 @@ void QGIRichAnno::textDragging(void) void QGIRichAnno::textDragFinished(void) { -// Base::Console().Message("QGIL::textDragFinished()\n"); +// Base::Console().Message("QGIRA::textDragFinished()\n"); auto anno( dynamic_cast(getFeature()) ); if( anno == nullptr ) { diff --git a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp index 940cfd3a34..a1ca8bcedd 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderPage.cpp +++ b/src/Mod/TechDraw/Gui/ViewProviderPage.cpp @@ -273,6 +273,7 @@ std::vector ViewProviderPage::claimChildren(void) const // DrawViewDimension // DrawViewBalloon // DrawLeader + // DrawRichAnno (if not a child of View) // any FeatuerView in a DrawViewClip // DrawHatch @@ -285,8 +286,10 @@ std::vector ViewProviderPage::claimChildren(void) const //DrawRichAnno with no parent is child of Page TechDraw::DrawRichAnno* dra = dynamic_cast (*it); if (dra != nullptr) { - if (dra->AnnoParent.getValue() == nullptr) { - temp.push_back(*it); + if (dra->AnnoParent.getValue() != nullptr) { + continue; //has a parent somewhere else + } else { + temp.push_back(*it); //no parent, belongs to page continue; } }