From f99ccc8ac2ba4ebcf2ae69e03ba9183ea71a0025 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Wed, 21 May 2014 23:31:26 -0300 Subject: Profile now correctly displays the planned dive. But it doesn't move the handlers yet, and when you confirm it you also must click on the dive to select it or the profile will show garbage. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'qt-ui/diveplanner.cpp') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index f4f3d5036..6e11f84aa 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -150,13 +150,6 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget *parent) : QGraphicsView(parent ADD_ACTION(Qt::Key_Right, keyRightAction()); #undef ADD_ACTION - connect(plannerModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(drawProfile())); - connect(plannerModel, SIGNAL(cylinderModelEdited()), this, SLOT(drawProfile())); - - connect(plannerModel, SIGNAL(rowsInserted(const QModelIndex &, int, int)), - this, SLOT(pointInserted(const QModelIndex &, int, int))); - connect(plannerModel, SIGNAL(rowsRemoved(const QModelIndex &, int, int)), - this, SLOT(pointsRemoved(const QModelIndex &, int, int))); setRenderHint(QPainter::Antialiasing); } @@ -504,23 +497,6 @@ void DivePlannerGraphics::drawProfile() depthLine->updateTicks(); } - // Re-position the user generated dive handlers - int last = 0; - for (int i = 0; i < plannerModel->rowCount(); i++) { - struct divedatapoint datapoint = plannerModel->at(i); - if (datapoint.time == 0) // those are the magic entries for tanks - continue; - DiveHandler *h = handles.at(i); - h->setPos(timeLine->posAtValue(datapoint.time / 60), depthLine->posAtValue(datapoint.depth)); - QPointF p1 = (last == i) ? QPointF(timeLine->posAtValue(0), depthLine->posAtValue(0)) : handles[last]->pos(); - QPointF p2 = handles[i]->pos(); - QLineF line(p1, p2); - QPointF pos = line.pointAt(0.5); - gases[i]->setPos(pos); - gases[i]->setText(dpGasToStr(plannerModel->at(i))); - last = i; - } - // (re-) create the profile with different colors for segments that were // entered vs. segments that were calculated double lastx = timeLine->posAtValue(0); @@ -1379,7 +1355,7 @@ void DivePlannerPointsModel::remove(const QModelIndex &index) endRemoveRows(); } -struct diveplan DivePlannerPointsModel::getDiveplan() +struct diveplan& DivePlannerPointsModel::getDiveplan() { return diveplan; } -- cgit v1.2.3-70-g09d2