summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-18 14:34:00 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-19 16:22:08 +1200
commit5a1be7620b4786d3522496e839bbdce5794f8ef9 (patch)
tree07f6d5197280e0aa680997cc5d1ad538d0771d47
parentf5726ffa9d21f80232b1206456eaf971468c4b2f (diff)
downloadsubsurface-5a1be7620b4786d3522496e839bbdce5794f8ef9.tar.gz
Only update the "add dive profile / plan dive" 20x/s
We were updating the dive quite a lot of times, we really didn't need to. This will help, but not fix, the issues with plan / add dive. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp6
-rw-r--r--qt-ui/diveplanner.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 44ca6baf5..2ee168413 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -181,6 +181,7 @@ DiveHandler::DiveHandler() : QGraphicsEllipseItem()
setFlags(ItemIgnoresTransformations | ItemIsSelectable | ItemIsMovable | ItemSendsGeometryChanges);
setBrush(Qt::white);
setZValue(2);
+ t.start();
}
int DiveHandler::parentIndex()
@@ -225,9 +226,14 @@ void DiveHandler::changeGas()
void DiveHandler::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
+ if (t.elapsed() < 40)
+ return;
+ t.start();
+
ProfileWidget2 *view = qobject_cast<ProfileWidget2*>(scene()->views().first());
if(view->isPointOutOfBoundaries(event->scenePos()))
return;
+
QGraphicsEllipseItem::mouseMoveEvent(event);
emit moved();
}
diff --git a/qt-ui/diveplanner.h b/qt-ui/diveplanner.h
index e6ae8e8b5..4093bacd1 100644
--- a/qt-ui/diveplanner.h
+++ b/qt-ui/diveplanner.h
@@ -133,6 +133,8 @@ public
slots:
void selfRemove();
void changeGas();
+private:
+ QTime t;
};
#include "ui_diveplanner.h"