Fix duplicate child claiming

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

View File

@@ -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");
}

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;
}
}