Fix duplicate child claiming

This commit is contained in:
wandererfan
2019-05-13 11:32:34 -04:00
committed by wmayer
parent 0944157b2e
commit 66df908450
3 changed files with 7 additions and 7 deletions

View File

@@ -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<TechDraw::DrawRichAnno*>(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<TechDraw::DrawRichAnno*>(getFeature()) );
if( anno == nullptr ) {

View File

@@ -273,6 +273,7 @@ std::vector<App::DocumentObject*> 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<App::DocumentObject*> ViewProviderPage::claimChildren(void) const
//DrawRichAnno with no parent is child of Page
TechDraw::DrawRichAnno* dra = dynamic_cast<TechDraw::DrawRichAnno*> (*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;
}
}