mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
3169ec8dc9
commit
6a1a6c82bf
2 changed files with 41 additions and 30 deletions
|
@ -50,6 +50,7 @@ slots:
|
|||
private:
|
||||
typedef QPair<QGraphicsPixmapItem *, QGraphicsSimpleTextItem *> ToolTip;
|
||||
QVector<ToolTip> toolTips;
|
||||
ToolTip entryToolTip;
|
||||
QGraphicsPathItem *background;
|
||||
QGraphicsLineItem *separator;
|
||||
QGraphicsSimpleTextItem *title;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue