mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Crash fixed on clicking on the canvas while no dive is loaded.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
parent
3e22e388e9
commit
ad8f96cd6e
1 changed files with 7 additions and 1 deletions
|
@ -114,7 +114,7 @@ extern struct ev_select *ev_namelist;
|
||||||
extern int evn_allocated;
|
extern int evn_allocated;
|
||||||
extern int evn_used;
|
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;
|
gc.printer = false;
|
||||||
setScene(new QGraphicsScene());
|
setScene(new QGraphicsScene());
|
||||||
|
@ -139,6 +139,9 @@ ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent
|
||||||
|
|
||||||
void ProfileGraphicsView::wheelEvent(QWheelEvent* event)
|
void ProfileGraphicsView::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
|
if (!toolTip)
|
||||||
|
return;
|
||||||
|
|
||||||
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
|
setTransformationAnchor(QGraphicsView::AnchorUnderMouse);
|
||||||
|
|
||||||
// Scale the view / do the zoom
|
// Scale the view / do the zoom
|
||||||
|
@ -157,6 +160,9 @@ void ProfileGraphicsView::wheelEvent(QWheelEvent* event)
|
||||||
|
|
||||||
void ProfileGraphicsView::mouseMoveEvent(QMouseEvent* event)
|
void ProfileGraphicsView::mouseMoveEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
|
if (!toolTip)
|
||||||
|
return;
|
||||||
|
|
||||||
toolTip->refresh(&gc, mapToScene(event->pos()));
|
toolTip->refresh(&gc, mapToScene(event->pos()));
|
||||||
|
|
||||||
QPoint toolTipPos = mapFromScene(toolTip->pos());
|
QPoint toolTipPos = mapFromScene(toolTip->pos());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue