1 #include <QGraphicsScene>
4 #include "branchitem.h"
5 #include "linkablemapobj.h"
9 /////////////////////////////////////////////////////////////////
11 /////////////////////////////////////////////////////////////////
13 XLinkItem::XLinkItem (const QList<QVariant> &data, TreeItem *parent):MapItem (data,parent)
16 //qDebug() << "Const XLinkItem () "<<this;
20 XLinkItem::~XLinkItem ()
22 //qDebug() << "Destr XLinkItem begin "<<this<<" pI="<<parentItem<<" link="<<link;
25 // tell the model to remove the link later
26 // (and then remove partner link in VymModel::cleanupLinks)
27 model->deleteLink (link);
28 link->removeXLinkItem (this);
31 //qDebug() << "Destr XLinkItem end"<<this;
35 void XLinkItem::init ()
41 void XLinkItem::setLink (Link *l)
46 Link* XLinkItem::getLink ()
51 void XLinkItem::updateXLink()
53 qDebug()<<"XLI::updateXLink";
58 BranchItem* XLinkItem::getPartnerBranch()
60 if (link && link->getBeginBranch() && link->getEndBranch())
62 if (parentItem==link->getBeginBranch())
63 return link->getEndBranch();
65 return link->getBeginBranch();