mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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>
This commit is contained in:
parent
2b19341609
commit
633dd64d2f
1 changed files with 1 additions and 1 deletions
|
@ -264,7 +264,7 @@ void ToolTipItem::refresh(const QPointF &pos)
|
||||||
}
|
}
|
||||||
free_buffer(&mb);
|
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())) {
|
,Qt::DescendingOrder, scene()->views().first()->transform())) {
|
||||||
if (!item->toolTip().isEmpty())
|
if (!item->toolTip().isEmpty())
|
||||||
addToolTip(item->toolTip());
|
addToolTip(item->toolTip());
|
||||||
|
|
Loading…
Reference in a new issue