3 #include "linkablemapobj.h"
4 #include "ornamentedobj.h"
11 MapItem::MapItem(const QList<QVariant> &data, TreeItem *parent):TreeItem (data,parent)
20 hideLinkUnselected=false;
23 void MapItem::appendChild (TreeItem *item)
25 TreeItem::appendChild (item);
27 // FIXME-4 maybe access parent in MapObjs directly via treeItem
28 // and remove this here...
30 // If lmo exists, also set parObj there
31 if (lmo && (item->isBranchLikeType() || item->getType()==TreeItem::Image) )
33 LinkableMapObj *itemLMO=((MapItem*)item)->lmo;
35 itemLMO->setParObj (lmo);
39 void MapItem::setRelPos (const QPointF &p)
45 ((OrnamentedObj*)lmo)->setUseRelPos (true);
46 ((OrnamentedObj*)lmo)->move2RelPos(p);
50 void MapItem::setAbsPos (const QPointF &p)
54 if (lmo) lmo->move (p);
57 void MapItem::setPositionMode (PositionMode mode)
62 void MapItem::setHideLinkUnselected (bool b)
65 if (lmo) lmo->setHideLinkUnselected();
68 bool MapItem::getHideLinkUnselected()
70 return hideLinkUnselected;
73 QString MapItem::getMapAttr ()
77 if (parentItem==rootItem)
81 if (type==TreeItem::Image ||depth()==1)
89 if (lmo) pos=lmo->getRelPos();
90 s= attribut("relPosX",QString().setNum(pos.x())) +
91 attribut("relPosY",QString().setNum(pos.y()));
94 if (lmo) pos=lmo->getAbsPos();
95 s=attribut("absPosX",QString().setNum(pos.x())) +
96 attribut("absPosY",QString().setNum(pos.y()));
100 if (hideLinkUnselected)
101 s+=attribut ("hideLink","true");
103 s+=attribut ("hideLink","false");
107 LinkableMapObj* MapItem::getLMO()
112 void MapItem::setLMO(LinkableMapObj *l)
117 void MapItem::initLMO()
123 lmo->setRelPos (pos);