Removed user-entered lines on the plan, keeping only deco.

Removed the user-entered lines on the plan, keeping only deco,
This way the graph looks way prettier and we don't loose any
functionality.

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-07-02 13:39:54 -03:00
parent effb7e2fac
commit a7506848b3

View file

@ -87,7 +87,7 @@ DivePlannerGraphics::DivePlannerGraphics(QWidget* parent): QGraphicsView(parent)
scene()->addItem(depthString);
diveBg = new QGraphicsPolygonItem();
diveBg->setBrush(QBrush(Qt::green));
diveBg->setPen(QPen(QBrush(),0));
scene()->addItem(diveBg);
plusDepth = new Button();
@ -233,12 +233,14 @@ void DivePlannerGraphics::createDecoStops()
for (dp = diveplan.dp; dp != NULL; dp = dp->next) {
double xpos = timeLine->posAtValue(dp->time / 60.0);
double ypos = depthLine->posAtValue(dp->depth / 1000.0);
QGraphicsLineItem *item = new QGraphicsLineItem(lastx, lasty, xpos, ypos);
item->setPen(QPen(QBrush(dp->entered ? Qt::black : Qt::red),0));
if(!dp->entered){
QGraphicsLineItem *item = new QGraphicsLineItem(lastx, lasty, xpos, ypos);
item->setPen(QPen(QBrush(Qt::red),0));
scene()->addItem(item);
lines << item;
}
lastx = xpos;
lasty = ypos;
scene()->addItem(item);
lines << item;
poly.append(QPointF(lastx, lasty));
}