Logo Search packages:      
Sourcecode: ktechlab version File versions

void MechanicsItem::reparented ( Item ,
) [protected, virtual]

Reinherit this function if you want to do anything with children. Called after the parent is changed, with the old parent and the new parent.

Reimplemented from Item.

Definition at line 108 of file mechanicsitem.cpp.

References absolutePosition(), moved(), and updateCanvasPoints().

      MechanicsItem *oldMechItem = dynamic_cast<MechanicsItem*>(oldItem);
      MechanicsItem *newMechItem = dynamic_cast<MechanicsItem*>(newItem);
      if (oldMechItem)
            m_relativePosition = oldMechItem->absolutePosition() + m_relativePosition;
            disconnect( oldMechItem, SIGNAL(moved()), this, SLOT(parentMoved()) );
      if (newMechItem)
            m_relativePosition = m_relativePosition - newMechItem->absolutePosition();
            connect( newMechItem, SIGNAL(moved()), this, SLOT(parentMoved()) );

Generated by  Doxygen 1.6.0   Back to index