diff options
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 751d685e5..571214f6f 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -214,15 +214,13 @@ void ProfileGraphicsView::plot(struct dive *d) resetTransform(); zoomLevel = 0; dive = d; + toolTip = 0; } - if(!isVisible()){ + if(!isVisible() || !dive){ return; } - if(!dive) - return; - scene()->setSceneRect(0,0, viewport()->width()-50, viewport()->height()-50); QSettings s; @@ -1278,8 +1276,12 @@ void ToolTipItem::collapse() void ToolTipItem::expand() { - QRectF nextRectangle; + if (!title){ + return; + } + + QRectF nextRectangle; double width = 0, height = title->boundingRect().height() + SPACING; Q_FOREACH(ToolTip t, toolTips) { if (t.second->boundingRect().width() > width) |