diff options
-rw-r--r-- | qt-ui/profile/divetooltipitem.cpp | 5 | ||||
-rw-r--r-- | qt-ui/profile/divetooltipitem.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp index 821c4a695..e89feff9c 100644 --- a/qt-ui/profile/divetooltipitem.cpp +++ b/qt-ui/profile/divetooltipitem.cpp @@ -159,6 +159,7 @@ ToolTipItem::ToolTipItem(QGraphicsItem *parent) : QGraphicsRectItem(parent), title->setBrush(Qt::white); setPen(QPen(Qt::white, 2)); + refreshTime.start(); } ToolTipItem::~ToolTipItem() @@ -240,6 +241,10 @@ void ToolTipItem::refresh(const QPointF &pos) static QPainter painter(&tissues); static struct membuffer mb = { 0 }; + if(refreshTime.elapsed() < 40) + return; + refreshTime.start(); + int time = timeAxis->valueAt(pos); if (time == lastTime) return; diff --git a/qt-ui/profile/divetooltipitem.h b/qt-ui/profile/divetooltipitem.h index 6235ec8d9..4fa7ec2d7 100644 --- a/qt-ui/profile/divetooltipitem.h +++ b/qt-ui/profile/divetooltipitem.h @@ -6,6 +6,7 @@ #include <QPair> #include <QRectF> #include <QIcon> +#include <QTime> #include "display.h" class DiveCartesianAxis; @@ -59,7 +60,7 @@ private: DiveCartesianAxis *timeAxis; plot_info pInfo; int lastTime; - + QTime refreshTime; QList<QGraphicsItem*> oldSelection; }; |