[TechDraw] Unify Projection Group parent linking

This commit is contained in:
pavltom
2024-03-14 10:16:02 +01:00
committed by WandererFan
parent fc8f93d437
commit 8a4f13fb16
8 changed files with 25 additions and 55 deletions

View File

@@ -69,7 +69,6 @@ const float labelCaptionFudge = 0.2f; // temp fiddle for devel
QGIView::QGIView()
:QGraphicsItemGroup(),
viewObj(nullptr),
m_locked(false),
m_innerView(false),
m_multiselectActivated(false)
{
@@ -157,15 +156,8 @@ QVariant QGIView::itemChange(GraphicsItemChange change, const QVariant &value)
// Base::Console().Message("QGIV::itemChange(%d)\n", change);
if(change == ItemPositionChange && scene()) {
newPos = value.toPointF(); //position within parent!
if(m_locked){
// ignore position change for locked items
newPos.setX(pos().x());
newPos.setY(pos().y());
return newPos;
}
TechDraw::DrawView *viewObj = getViewObject();
if (viewObj->isDerivedFrom(TechDraw::DrawProjGroupItem::getClassTypeId())) {
// restrict movements of secondary views.
TechDraw::DrawProjGroupItem* dpgi = static_cast<TechDraw::DrawProjGroupItem*>(viewObj);