summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetooltipitem.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-01-14 17:11:41 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-15 14:46:57 +1300
commit6a1a6c82bfbbc455f2c0c9ec85216f248b3152b6 (patch)
treefdefe2cea5c786579c3e752dbb0b7b2726eb97c8 /qt-ui/profile/divetooltipitem.h
parent3169ec8dc9cf7f385a6662a3d75396c24ba0da5c (diff)
downloadsubsurface-6a1a6c82bfbbc455f2c0c9ec85216f248b3152b6.tar.gz
Reuse the entry tooltip item and do fewer calls for each mouse move
While analizing the code for the mouse movement I've discovered that we did a lot of uneeded things: Set the color, the pen, the size of a fixed-colored line, twice. We also deleted-newed the same Pixmap / Text for every mouse movement so now we reuse the 'entryToolTip' that consists of a huge line and a pixmap, and after that we add the other tooltips that are not static Also, reduced a lot the number of calls to expand() (that did a lot of math). Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divetooltipitem.h')
-rw-r--r--qt-ui/profile/divetooltipitem.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/qt-ui/profile/divetooltipitem.h b/qt-ui/profile/divetooltipitem.h
index bb3ad84d3..ca5bc8905 100644
--- a/qt-ui/profile/divetooltipitem.h
+++ b/qt-ui/profile/divetooltipitem.h
@@ -50,6 +50,7 @@ slots:
private:
typedef QPair<QGraphicsPixmapItem *, QGraphicsSimpleTextItem *> ToolTip;
QVector<ToolTip> toolTips;
+ ToolTip entryToolTip;
QGraphicsPathItem *background;
QGraphicsLineItem *separator;
QGraphicsSimpleTextItem *title;