> in terms of leaks, the profile mouse over is leaking about 1mb every
> 15 seconds, but that could be Qt related (if we can isolate it in a
> simple test app that is).
>

I'v answered lubomir with a 7mbs+ callgrind file data so he can help me
triage this, in the meantime, another patch to reduce the amount of calls
uneeded in the mouseMoveEvent calls. :)
I'm thinkering of a way to reduce the amount of new's and deletes in the
toolTipItem now.
From 51e5991f61a9cdd35f18bae5084abe3c7d7933a6 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <[email protected]>
Date: Wed, 14 Jan 2015 14:41:56 -0200
Subject: [PATCH 3/3] Speed Improvemens: less calls to mapFromScene /
 mapToScene

We did three cals to mapToScene / mapFromScene on the mouse
moveEvent at the ProfileWidget2 where we only needed to call
one in the common case and two in the worst case. this doesn't
really helps in terms of speed ( unless you have a really old cpu )
but since it's a code that gets called *very* often, seemed a reasonably
thing to do.

Signed-off-by: Tomaz Canabrava <[email protected]>
---
 qt-ui/profile/profilewidget2.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 87339e2..b161032 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -814,16 +814,16 @@ void ProfileWidget2::scrollViewTo(const QPoint &pos)
 
 void ProfileWidget2::mouseMoveEvent(QMouseEvent *event)
 {
-	toolTipItem->refresh(mapToScene(event->pos()));
-	QPoint toolTipPos = mapFromScene(toolTipItem->pos());
+	QPointF pos = mapToScene(event->pos());
+	toolTipItem->refresh(pos);
 	if (zoomLevel == 0) {
 		QGraphicsView::mouseMoveEvent(event);
 	} else {
+		QPoint toolTipPos = mapFromScene(toolTipItem->pos());
 		scrollViewTo(event->pos());
 		toolTipItem->setPos(mapToScene(toolTipPos));
 	}
 
-	QPointF pos = mapToScene(event->pos());
 	qreal vValue = profileYAxis->valueAt(pos);
 	qreal hValue = timeAxis->valueAt(pos);
 	if (profileYAxis->maximum() >= vValue && profileYAxis->minimum() <= vValue) {
-- 
2.2.2

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to