summaryrefslogtreecommitdiffstats
path: root/qt-ui/profilegraphics.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-13 15:28:17 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-13 15:28:17 -0300
commit61373eaccf506d022e3c31715b31c2b9432b6f49 (patch)
treee469dd9a96108129c38151d5893176560688c10f /qt-ui/profilegraphics.cpp
parent605f42daa41d74ebacca686b35f03240467f661a (diff)
downloadsubsurface-61373eaccf506d022e3c31715b31c2b9432b6f49.tar.gz
Fix segfault on mouseOver at the Profile with an invalid dive selected ( trip )
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r--qt-ui/profilegraphics.cpp12
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)