From 1ac0b00662e55ead4c1ddc1335e548cb846585db Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 30 Jun 2014 19:08:16 -0300 Subject: Only replot the dive if maxDepth > oldMaxDepth on plan / add mode. This fixes the "impossible to work with" planner with the mouse now the dive will only grow and not shrink untill you release the mouse. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'qt-ui/diveplanner.cpp') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index e6c1889d5..44449a52a 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -258,6 +258,18 @@ void DiveHandler::mouseMoveEvent(QGraphicsSceneMouseEvent *event) emit moved(); } +void DiveHandler::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + QGraphicsItem::mousePressEvent(event); + emit clicked(); +} + +void DiveHandler::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) +{ + QGraphicsItem::mouseReleaseEvent(event); + emit released(); +} + DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f) { ui.setupUi(this); -- cgit v1.2.3-70-g09d2