aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget/divetooltipitem.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-02-12 18:32:40 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-02-12 11:27:01 -0800
commit6ef4f377f0a6bc567f82fa34764c1d81cdab5a1a (patch)
tree3dbfaacf3e98a237e831b0223721618a2b93dec1 /profile-widget/divetooltipitem.cpp
parentb9cd9e17d18a25094345d02e13bcc05fbde2143b (diff)
downloadsubsurface-6ef4f377f0a6bc567f82fa34764c1d81cdab5a1a.tar.gz
cleanup: remove dead code from ToolTipItem::addToolTip()
There was never an icon passed to this function. Therefore, remove the parameter and the code that depends on it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/divetooltipitem.cpp')
-rw-r--r--profile-widget/divetooltipitem.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/profile-widget/divetooltipitem.cpp b/profile-widget/divetooltipitem.cpp
index e4205fada..aec8de96a 100644
--- a/profile-widget/divetooltipitem.cpp
+++ b/profile-widget/divetooltipitem.cpp
@@ -9,7 +9,7 @@
#include <QGraphicsView>
#include "core/qthelper.h"
-void ToolTipItem::addToolTip(const QString &toolTip, const QIcon &icon, const QPixmap &pixmap)
+void ToolTipItem::addToolTip(const QString &toolTip, const QPixmap &pixmap)
{
const IconMetrics &iconMetrics = defaultIconMetrics();
@@ -22,11 +22,8 @@ void ToolTipItem::addToolTip(const QString &toolTip, const QIcon &icon, const QP
yValue += entryToolTip.second->boundingRect().height();
}
iconItem = new QGraphicsPixmapItem(this);
- if (!icon.isNull()) {
- iconItem->setPixmap(icon.pixmap(iconMetrics.sz_small, iconMetrics.sz_small));
- } else if (!pixmap.isNull()) {
+ if (!pixmap.isNull())
iconItem->setPixmap(pixmap);
- }
const int sp2 = iconMetrics.spacing * 2;
iconItem->setPos(sp2, yValue);
@@ -148,7 +145,7 @@ ToolTipItem::ToolTipItem(QGraphicsItem *parent) : RoundRectItem(8.0, parent),
setZValue(99);
- addToolTip(QString(), QIcon(), QPixmap(16,60));
+ addToolTip(QString(), QPixmap(16,60));
entryToolTip = toolTips.first();
toolTips.clear();
@@ -267,7 +264,7 @@ void ToolTipItem::refresh(const dive *d, const QPointF &pos)
scene()->views().first()->transform());
for (QGraphicsItem *item: l) {
if (!item->toolTip().isEmpty())
- addToolTip(item->toolTip());
+ addToolTip(item->toolTip(), QPixmap());
}
expand();
}