From 6ef4f377f0a6bc567f82fa34764c1d81cdab5a1a Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 12 Feb 2021 18:32:40 +0100 Subject: [PATCH] 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 --- profile-widget/divetooltipitem.cpp | 11 ++++------- profile-widget/divetooltipitem.h | 2 +- 2 files changed, 5 insertions(+), 8 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 #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(); } diff --git a/profile-widget/divetooltipitem.h b/profile-widget/divetooltipitem.h index 78a6d09ca..c19cbd138 100644 --- a/profile-widget/divetooltipitem.h +++ b/profile-widget/divetooltipitem.h @@ -62,7 +62,7 @@ private: QElapsedTimer refreshTime; QList oldSelection; - void addToolTip(const QString &toolTip, const QIcon &icon = QIcon(), const QPixmap &pixmap = QPixmap()); + void addToolTip(const QString &toolTip, const QPixmap &pixmap); }; #endif // DIVETOOLTIPITEM_H