diff -r 96402b172173 -r a8a98a94899a selection.cpp --- a/selection.cpp Wed Oct 29 17:42:34 2008 +0000 +++ b/selection.cpp Tue Nov 04 12:09:10 2008 +0000 @@ -11,7 +11,6 @@ Selection::Selection() { - color= QColor(255,255,0); blocked=false; } @@ -22,7 +21,7 @@ void Selection::setModel (VymModel *m) { model=m; - scene=model->getScene(); + selModel=model->getSelectionModel(); } void Selection::copy(const Selection &other) @@ -37,36 +36,28 @@ lastSelectList.clear(); } -void Selection::update() // FIXME this needs to be adapted to several views +void Selection::update() // TODO this needs to be adapted to several views { QRectF bbox; - int w=0; + //int w=0; for (int i=0; i< selectList.count(); ++i) { bbox=selectList.at(i)->getBBox(); + /* FIXME VM move to MapEditor selboxList.at(i)->setRect ( bbox.x()-w,bbox.y()-w, bbox.width()+2*w, bbox.height()+2*w); selboxList.at(i)->setPen (color); selboxList.at(i)->setBrush (color); + */ } } -void Selection::setColor (QColor col) -{ - color=col; - update(); -} - -QColor Selection::getColor () -{ - return color; -} - bool Selection::select(LinkableMapObj *lmo) // TODO no multiselections yet { if (!selectList.isEmpty()) unselect(); selectList.append (lmo); + /* FIXME VM move to ME QGraphicsRectItem *sb = scene->addRect( QRectF(0,0,0,0), QPen(color), @@ -74,6 +65,7 @@ sb->setZValue(Z_SELBOX); sb->show(); selboxList.append (sb); + */ lmo->select(); update(); mainWindow->updateSatellites (model); @@ -114,8 +106,10 @@ selectList.at(i)->unselect(); lastSelectList=selectList; selectList.clear(); - while (!selboxList.isEmpty() ) + /* FIXME VM move to ME + while (!selboxList.isEmpty() ) delete selboxList.takeFirst(); + */ } } @@ -188,10 +182,16 @@ TreeItem* Selection::getBranchItem() { BranchObj* bo=getBranch(); - if (bo) return bo->getTreeItem(); + if (bo) return bo->getTreeItem(); // FIXME VM get directly from treemodl return NULL; } +QModelIndex Selection::getBranchIndex() +{ + return selModel->selectedIndexes().first(); // TODO no multiselections yet + +} + FloatImageObj* Selection::getFloatImage() { if (!selectList.isEmpty())