diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-05-10 11:59:17 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-10 11:59:17 -0700 |
commit | 1245c232dba019d5a87102b93c1a011e0998b47c (patch) | |
tree | 77d7f0516b0d5f8d14a0d5dfaf913909a49b73b7 /qt-ui | |
parent | 719ce1bab3d2189e64ea69898c5f317e967cb3fb (diff) | |
parent | ad8f96cd6efdec59cbec7e10571de2e9c2496d9e (diff) | |
download | subsurface-1245c232dba019d5a87102b93c1a011e0998b47c.tar.gz |
Merge branch 'fixCrash' of https://github.com/tcanabrava/subsurface into Qt
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index c2f71be11..6e699fe51 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -114,7 +114,7 @@ extern struct ev_select *ev_namelist; extern int evn_allocated; extern int evn_used; -ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent) , dive(0) +ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent) , dive(0), toolTip(0) { gc.printer = false; setScene(new QGraphicsScene()); @@ -138,6 +138,9 @@ ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent void ProfileGraphicsView::wheelEvent(QWheelEvent* event) { + if (!toolTip) + return; + setTransformationAnchor(QGraphicsView::AnchorUnderMouse); // Scale the view / do the zoom @@ -156,6 +159,9 @@ void ProfileGraphicsView::wheelEvent(QWheelEvent* event) void ProfileGraphicsView::mouseMoveEvent(QMouseEvent* event) { + if (!toolTip) + return; + toolTip->refresh(&gc, mapToScene(event->pos())); QPoint toolTipPos = mapFromScene(toolTip->pos()); |