3 #include "linkablemapobj.h"
4 #include "ornamentedobj.h"
13 MapItem::MapItem(const QList<QVariant> &data, TreeItem *parent):TreeItem (data,parent)
22 hideLinkUnselected=false;
25 void MapItem::appendChild (TreeItem *item)
27 TreeItem::appendChild (item);
29 // FIXME-4 maybe access parent in MapObjs directly via treeItem
30 // and remove this here...
32 // If lmo exists, also set parObj there
33 if (lmo && (item->isBranchLikeType() || item->getType()==TreeItem::Image) )
35 LinkableMapObj *itemLMO=((MapItem*)item)->lmo;
37 itemLMO->setParObj (lmo);
41 void MapItem::setRelPos (const QPointF &p)
47 ((OrnamentedObj*)lmo)->setUseRelPos (true);
48 ((OrnamentedObj*)lmo)->move2RelPos(p);
52 void MapItem::setAbsPos (const QPointF &p)
56 if (lmo) lmo->move (p);
59 void MapItem::setPositionMode (PositionMode mode)
64 void MapItem::setHideLinkUnselected (bool b)
69 //lmo->setHideLinkUnselected();
70 lmo->setVisibility (lmo->isVisibleObj());
71 lmo->updateLinkGeometry();
75 bool MapItem::getHideLinkUnselected()
77 return hideLinkUnselected;
80 QString MapItem::getMapAttr ()
84 if (parentItem==rootItem)
88 if (type==TreeItem::Image ||depth()==1)
96 if (lmo) pos=lmo->getRelPos();
97 s= attribut("relPosX",QString().setNum(pos.x())) +
98 attribut("relPosY",QString().setNum(pos.y()));
101 if (lmo) pos=lmo->getAbsPos();
102 s=attribut("absPosX",QString().setNum(pos.x())) +
103 attribut("absPosY",QString().setNum(pos.y()));
107 if (hideLinkUnselected)
108 s+=attribut ("hideLink","true");
110 s+=attribut ("hideLink","false");
114 QRectF MapItem::getBBoxURLFlag ()
116 QStringList list=systemFlags.activeFlagNames().filter ("system-url");
119 qWarning()<<"MapItem::getBBoxURLFlag found more than one system-url*";
122 return getBBoxFlag (list.first());
125 QRectF MapItem::getBBoxFlag (const QString &fname)
128 return ((OrnamentedObj*)lmo)->getBBoxFlag (fname);
133 LinkableMapObj* MapItem::getLMO()
138 void MapItem::setLMO(LinkableMapObj *l)
143 void MapItem::initLMO()
149 lmo->setRelPos (pos);