diff options
author | Tomaz Canabrava <tomaz.canabrava@intel.com> | 2015-01-16 16:45:13 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-17 08:07:14 +1300 |
commit | ac40c458facfa4f641c1cf2a2384d955431cdb7c (patch) | |
tree | 4da3500a0be84e348a5516e2a784bbd6c5223199 /qt-ui/profile/divetooltipitem.cpp | |
parent | 67865a86be1f22231037d2209baa731fac55ad4e (diff) | |
download | subsurface-ac40c458facfa4f641c1cf2a2384d955431cdb7c.tar.gz |
Reduce the refresh rate of the toolTipItem to 25fps.
This reduces a lot of CPU time and makes the overall use of the tooltip a
breeze.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divetooltipitem.cpp')
-rw-r--r-- | qt-ui/profile/divetooltipitem.cpp | 5 |
1 files changed, 5 insertions, 0 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; |