8 /////////////////////////////////////////////////////////////////
10 /////////////////////////////////////////////////////////////////
12 FloatObj::FloatObj(QGraphicsItem *parent, TreeItem *ti)
13 : OrnamentedObj(parent, ti)
15 // qDebug() << "Const FloatObj s="<<s<<" ti="<<ti<<" treeItem="<<treeItem;
21 // qDebug() << "Destr FloatObj";
26 setLinkStyle(LinkableMapObj::Parabel);
27 ((MapItem *)treeItem)->setHideLinkUnselected(true);
30 void FloatObj::copy(FloatObj *other)
32 LinkableMapObj::copy(other);
33 setVisibility(other->visible);
36 void FloatObj::move(double x, double y) { MapObj::move(x, y); }
38 void FloatObj::move(QPointF p) { FloatObj::move(p.x(), p.y()); }
40 void FloatObj::moveCenter(double x, double y)
42 absPos = QPointF(x, y);
43 bbox.moveTo(x - bbox.width() / 2, y - bbox.height() / 2);
44 clickPoly = QPolygonF(bbox);
47 void FloatObj::moveCenter2RelPos(double x, double y)
49 setRelPos(QPointF(x, y));
51 QPointF p = parObj->getFloatRefPos();
52 moveCenter(p.x() + x, p.y() + y);
56 void FloatObj::move2RelPos(
57 double x, double y) // overloaded to use floatRefPos instead of childRefPos
59 setRelPos(QPointF(x, y));
61 QPointF p = parObj->getFloatRefPos();
62 move(p.x() + x, p.y() + y);
66 void FloatObj::move2RelPos(
67 QPointF p) // overloaded to use floatRefPos instead of childRefPos
69 move2RelPos(p.x(), p.y());
72 void FloatObj::setRelPos()
75 setRelPos(absPos - parObj->getFloatRefPos());
77 qWarning() << "FO::setRelPos parObj==0 this=" << this;
80 void FloatObj::setRelPos(const QPointF &p)
87 qWarning() << "LMO::setRelPos (p) parObj==0 this=" << this;
90 void FloatObj::setDockPos() { parPos = absPos; }
92 void FloatObj::reposition()
94 moveCenter2RelPos(relPos.x(), relPos.y());
98 QRectF FloatObj::getBBoxSizeWithChildren() { return bboxTotal; }