Support more than one event of the same type in Qt tooltip.

Since the tooltip text was used as key in the map, two events of the
same type, close to eachother, would cause one of them to not be
removed.

Since ToolTip::removeToolTip() isn't used, we don't need a QMap and can
use a QList instead, so all tooltips are properly cleared.

Signed-off-by: Michael Andreen <harv@ruin.nu>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Michael Andreen 2013-07-30 23:36:20 +02:00 committed by Dirk Hohndel
parent 396b2d1031
commit 069f588d9d
2 changed files with 2 additions and 25 deletions

View file

@ -35,7 +35,6 @@ public:
void expand();
void clear();
void addToolTip(const QString& toolTip, const QIcon& icon = QIcon());
void removeToolTip(const QString& toolTip);
void refresh(struct graphics_context* gc, QPointF pos);
bool isExpanded();
void persistPos();
@ -48,7 +47,7 @@ public slots:
private:
typedef QPair<QGraphicsPixmapItem*, QGraphicsSimpleTextItem*> ToolTip;
QMap<QString, ToolTip > toolTips;
QList<ToolTip> toolTips;
QGraphicsPathItem *background;
QGraphicsLineItem *separator;
QGraphicsSimpleTextItem *title;