summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-14 12:52:23 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-15 07:20:35 +1300
commit633dd64d2fa18b64fd13a593019a42316c1de775 (patch)
tree13985c36f8bd3340f9320f3bbc0cefe2e2504595 /qt-ui
parent2b193416090f3ca9795513d94028557c96aed0b4 (diff)
downloadsubsurface-633dd64d2fa18b64fd13a593019a42316c1de775.tar.gz
Major speedup when moving the mouse in the profile
After looking with great care at the result of the mouse movement on the profile, and also playing a bit with callgrind I've found out that one thing that we were doing wrong was the way we looked at the items in the scene, by calling scene()->items with Qt::ItemIntersectsShape, our shapes are very complex curves with thousends of points and we have lots of them. and it usually doesn't matter because *most* of the time we are getting the tooltip information from 'get_plot_details_new', so no accessing to items was necessary. By changing the access from Qt::ItemIntersectsShape to Qt::IntersectsItemBoundingRect we had a speedup of almost 500x in a section of code that's very important, and the good thing, nothing bad happened because one of the only things that we are using this code is to get information from the events, not the curves. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/profile/divetooltipitem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp
index 78bdc71a1..7f7627309 100644
--- a/qt-ui/profile/divetooltipitem.cpp
+++ b/qt-ui/profile/divetooltipitem.cpp
@@ -264,7 +264,7 @@ void ToolTipItem::refresh(const QPointF &pos)
}
free_buffer(&mb);
- Q_FOREACH (QGraphicsItem *item, scene()->items(pos, Qt::IntersectsItemShape
+ Q_FOREACH (QGraphicsItem *item, scene()->items(pos, Qt::IntersectsItemBoundingRect
,Qt::DescendingOrder, scene()->views().first()->transform())) {
if (!item->toolTip().isEmpty())
addToolTip(item->toolTip());