From 0539a5fab67a83da223425e6fcbf2d8775be90e3 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 20 Jun 2013 18:02:01 -0300 Subject: Restore the original color of the Handler as soon as mouseRelease. Restore the original color of the handler as soon as mouseRelease, also a bit of code cleanup. Signed-off-by: Tomaz Canabrava --- qt-ui/diveplanner.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 33a759f1d..4d9aefcb1 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -47,8 +47,6 @@ DivePlanner::DivePlanner(QWidget* parent): QGraphicsView(parent), activeDraggedH depthString = new QGraphicsSimpleTextItem(); depthString->setFlag(QGraphicsItem::ItemIgnoresTransformations); scene()->addItem(depthString); - - } void DivePlanner::mouseDoubleClickEvent(QMouseEvent* event) @@ -109,9 +107,6 @@ void DivePlanner::clear_generated_deco() void DivePlanner::create_deco_stop() { - // this needs to create everything - // for the calculated deco. it should return the *first* - // line that's calculated, so the QGraphicsLineItem *item = new QGraphicsLineItem(handles.last()->x(), handles.last()->y(), 100, 0); scene()->addItem(item); lines << item; @@ -227,8 +222,9 @@ void DivePlanner::mouseReleaseEvent(QMouseEvent* event) { if (activeDraggedHandler){ QPointF mappedPos = mapToScene(event->pos()); - activeDraggedHandler ->setTime(timeLine->valueAt(mappedPos)); - activeDraggedHandler ->setDepth(depthLine->valueAt(mappedPos)); + activeDraggedHandler->setTime(timeLine->valueAt(mappedPos)); + activeDraggedHandler->setDepth(depthLine->valueAt(mappedPos)); + activeDraggedHandler->setBrush(QBrush()); activeDraggedHandler = 0; } } -- cgit v1.2.3-70-g09d2