summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-06-30 19:08:16 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-30 16:06:53 -0700
commit1ac0b00662e55ead4c1ddc1335e548cb846585db (patch)
tree90c2f8f6d3220aed7c471a7eec35064a9e21ebe4 /qt-ui/diveplanner.cpp
parent4da7dee8cf18c17c451e9d9885545dcdd1ba22c7 (diff)
downloadsubsurface-1ac0b00662e55ead4c1ddc1335e548cb846585db.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp12
1 files changed, 12 insertions, 0 deletions
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);