mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
b9cd9e17d1
commit
6ef4f377f0
2 changed files with 5 additions and 8 deletions
|
@ -9,7 +9,7 @@
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
#include "core/qthelper.h"
|
#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();
|
const IconMetrics &iconMetrics = defaultIconMetrics();
|
||||||
|
|
||||||
|
@ -22,11 +22,8 @@ void ToolTipItem::addToolTip(const QString &toolTip, const QIcon &icon, const QP
|
||||||
yValue += entryToolTip.second->boundingRect().height();
|
yValue += entryToolTip.second->boundingRect().height();
|
||||||
}
|
}
|
||||||
iconItem = new QGraphicsPixmapItem(this);
|
iconItem = new QGraphicsPixmapItem(this);
|
||||||
if (!icon.isNull()) {
|
if (!pixmap.isNull())
|
||||||
iconItem->setPixmap(icon.pixmap(iconMetrics.sz_small, iconMetrics.sz_small));
|
|
||||||
} else if (!pixmap.isNull()) {
|
|
||||||
iconItem->setPixmap(pixmap);
|
iconItem->setPixmap(pixmap);
|
||||||
}
|
|
||||||
const int sp2 = iconMetrics.spacing * 2;
|
const int sp2 = iconMetrics.spacing * 2;
|
||||||
iconItem->setPos(sp2, yValue);
|
iconItem->setPos(sp2, yValue);
|
||||||
|
|
||||||
|
@ -148,7 +145,7 @@ ToolTipItem::ToolTipItem(QGraphicsItem *parent) : RoundRectItem(8.0, parent),
|
||||||
|
|
||||||
setZValue(99);
|
setZValue(99);
|
||||||
|
|
||||||
addToolTip(QString(), QIcon(), QPixmap(16,60));
|
addToolTip(QString(), QPixmap(16,60));
|
||||||
entryToolTip = toolTips.first();
|
entryToolTip = toolTips.first();
|
||||||
toolTips.clear();
|
toolTips.clear();
|
||||||
|
|
||||||
|
@ -267,7 +264,7 @@ void ToolTipItem::refresh(const dive *d, const QPointF &pos)
|
||||||
scene()->views().first()->transform());
|
scene()->views().first()->transform());
|
||||||
for (QGraphicsItem *item: l) {
|
for (QGraphicsItem *item: l) {
|
||||||
if (!item->toolTip().isEmpty())
|
if (!item->toolTip().isEmpty())
|
||||||
addToolTip(item->toolTip());
|
addToolTip(item->toolTip(), QPixmap());
|
||||||
}
|
}
|
||||||
expand();
|
expand();
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ private:
|
||||||
QElapsedTimer refreshTime;
|
QElapsedTimer refreshTime;
|
||||||
QList<QGraphicsItem*> oldSelection;
|
QList<QGraphicsItem*> 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
|
#endif // DIVETOOLTIPITEM_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue