diff options
-rw-r--r-- | profile-widget/divetooltipitem.cpp | 7 | ||||
-rw-r--r-- | profile-widget/divetooltipitem.h | 1 | ||||
-rw-r--r-- | profile-widget/profilewidget2.cpp | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/profile-widget/divetooltipitem.cpp b/profile-widget/divetooltipitem.cpp index 16be94c15..908f40070 100644 --- a/profile-widget/divetooltipitem.cpp +++ b/profile-widget/divetooltipitem.cpp @@ -139,7 +139,7 @@ ToolTipItem::ToolTipItem(QGraphicsItem *parent) : QGraphicsRectItem(parent), timeAxis(0), lastTime(-1) { - memset(&pInfo, 0, sizeof(pInfo)); + clearPlotInfo(); entryToolTip.first = NULL; entryToolTip.second = NULL; setFlags(ItemIgnoresTransformations | ItemIsMovable | ItemClipsChildrenToShape); @@ -223,6 +223,11 @@ void ToolTipItem::setPlotInfo(const plot_info &plot) pInfo = plot; } +void ToolTipItem::clearPlotInfo() +{ + memset(&pInfo, 0, sizeof(pInfo)); +} + void ToolTipItem::setTimeAxis(DiveCartesianAxis *axis) { timeAxis = axis; diff --git a/profile-widget/divetooltipitem.h b/profile-widget/divetooltipitem.h index 714782843..0ae399bcb 100644 --- a/profile-widget/divetooltipitem.h +++ b/profile-widget/divetooltipitem.h @@ -44,6 +44,7 @@ public: void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); void setTimeAxis(DiveCartesianAxis *axis); void setPlotInfo(const plot_info &plot); + void clearPlotInfo(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); public slots: diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 54225a0fc..a85410892 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -1134,6 +1134,7 @@ void ProfileWidget2::setEmptyState() ccrsensor3GasItem->setVisible(false); ocpo2GasItem->setVisible(false); #ifndef SUBSURFACE_MOBILE + toolTipItem->clearPlotInfo(); toolTipItem->setVisible(false); diveCeiling->setVisible(false); decoModelParameters->setVisible(false); |