diff -r 5db8dfd30ea2 -r c2a05fa925a1 flagrowobj.cpp --- a/flagrowobj.cpp Thu Nov 23 16:18:26 2006 +0000 +++ b/flagrowobj.cpp Fri Dec 08 20:18:56 2006 +0000 @@ -11,9 +11,9 @@ init (); } -FlagRowObj::FlagRowObj(Q3Canvas* c):MapObj(c) +FlagRowObj::FlagRowObj(QGraphicsScene* s):MapObj(s) { -// cout << "Const FlagRowObj\n"; +// cout << "Const FlagRowObj (s)\n"; init (); } @@ -53,11 +53,11 @@ void FlagRowObj::move(double x, double y) { MapObj::move(x,y); - int dx=0; + qreal dx=0; for (int i=0; imove(x+dx,y); - dx+=QSize(flag.at(i)->getSize() ).width(); + dx+=QSizeF(flag.at(i)->getSize() ).width(); } } @@ -75,9 +75,9 @@ FlagObj* FlagRowObj::addFlag (FlagObj *fo) { - FlagObj *newfo=new FlagObj (canvas); + FlagObj *newfo=new FlagObj (scene); + newfo->copy (fo); // create a deep copy of fo newfo->move (absPos.x() + bbox.width(), absPos.y() ); - newfo->copy (fo); // create a deep copy of fo flag.append(newfo); calcBBoxSize(); positionBBox(); @@ -92,8 +92,8 @@ void FlagRowObj::calcBBoxSize() { - QSize size(0,0); - QSize boxsize(0,0); + QSizeF size(0,0); + QSizeF boxsize(0,0); for (int i=0; igetSize(); @@ -107,7 +107,7 @@ clickBox.setSize (boxsize); } -QString FlagRowObj::getFlagName (const QPoint &p) +QString FlagRowObj::getFlagName (const QPointF &p) { if (!inBox (p)) return ""; for (int i=0; ideactivate(); + if (flag.at(i)->isActive()) flag.at(i)->deactivate(); } else qWarning ("FlagRowObj::deactivateAll mustn't be called for ordinary rows"); } @@ -222,7 +227,11 @@ { for (int i=0; igetGroup() && keepfo!=flag.at(i)) + { flag.remove(flag.at(i)); + //FIXME also delete flags + //and better only delete flags that are really set + } } } }