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>
This commit is contained in:
Tomaz Canabrava 2015-01-18 14:34:00 -02:00 committed by Dirk Hohndel
parent f5726ffa9d
commit 5a1be7620b
2 changed files with 8 additions and 0 deletions

View file

@ -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();
}

View file

@ -133,6 +133,8 @@ public
slots:
void selfRemove();
void changeGas();
private:
QTime t;
};
#include "ui_diveplanner.h"