Commit c966c489 authored by lassoan's avatar lassoan
Browse files

BUG: Fixed resetting default mouse cursor in Segment editor

git-svn-id: http://svn.slicer.org/Slicer4/trunk@28011 3bd1e089-480b-0410-8dfb-8563597acbee
parent 9b8bc06c
...@@ -431,3 +431,17 @@ void qMRMLSliceView::setViewCursor(const QCursor &cursor) ...@@ -431,3 +431,17 @@ void qMRMLSliceView::setViewCursor(const QCursor &cursor)
} }
#endif #endif
} }
// --------------------------------------------------------------------------
void qMRMLSliceView::unsetViewCursor()
{
this->unsetCursor();
#if VTK_MAJOR_VERSION >= 9 || (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 2)
if (this->VTKWidget() != NULL)
{
// TODO: it would be better to restore default cursor, but QVTKOpenGLNativeWidget
// API does not have an accessor method to the default cursor.
this->VTKWidget()->setQVTKCursor(QCursor(Qt::ArrowCursor));
}
#endif
}
...@@ -90,6 +90,9 @@ public: ...@@ -90,6 +90,9 @@ public:
/// Set cursor in the view area /// Set cursor in the view area
Q_INVOKABLE void setViewCursor(const QCursor &); Q_INVOKABLE void setViewCursor(const QCursor &);
/// Restore default cursor in the view area
Q_INVOKABLE void unsetViewCursor();
public slots: public slots:
/// Set the MRML \a scene that should be listened for events /// Set the MRML \a scene that should be listened for events
......
...@@ -536,3 +536,17 @@ void qMRMLThreeDView::setViewCursor(const QCursor &cursor) ...@@ -536,3 +536,17 @@ void qMRMLThreeDView::setViewCursor(const QCursor &cursor)
} }
#endif #endif
} }
// --------------------------------------------------------------------------
void qMRMLThreeDView::unsetViewCursor()
{
this->unsetCursor();
#if VTK_MAJOR_VERSION >= 9 || (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 2)
if (this->VTKWidget() != NULL)
{
// TODO: it would be better to restore default cursor, but QVTKOpenGLNativeWidget
// API does not have an accessor method to the default cursor.
this->VTKWidget()->setQVTKCursor(QCursor(Qt::ArrowCursor));
}
#endif
}
...@@ -79,6 +79,9 @@ public: ...@@ -79,6 +79,9 @@ public:
/// Set cursor in the view area /// Set cursor in the view area
Q_INVOKABLE void setViewCursor(const QCursor &); Q_INVOKABLE void setViewCursor(const QCursor &);
/// Restore default cursor in the view area
Q_INVOKABLE void unsetViewCursor();
public slots: public slots:
/// Set the MRML \a scene that should be listened for events /// Set the MRML \a scene that should be listened for events
......
...@@ -802,7 +802,7 @@ void qMRMLSegmentEditorWidgetPrivate::setEffectCursor(qSlicerSegmentEditorAbstra ...@@ -802,7 +802,7 @@ void qMRMLSegmentEditorWidgetPrivate::setEffectCursor(qSlicerSegmentEditorAbstra
} }
else else
{ {
sliceWidget->sliceView()->unsetCursor(); sliceWidget->sliceView()->unsetViewCursor();
} }
} }
for (int threeDViewId = 0; threeDViewId < layoutManager->threeDViewCount(); ++threeDViewId) for (int threeDViewId = 0; threeDViewId < layoutManager->threeDViewCount(); ++threeDViewId)
...@@ -818,7 +818,7 @@ void qMRMLSegmentEditorWidgetPrivate::setEffectCursor(qSlicerSegmentEditorAbstra ...@@ -818,7 +818,7 @@ void qMRMLSegmentEditorWidgetPrivate::setEffectCursor(qSlicerSegmentEditorAbstra
} }
else else
{ {
threeDWidget->threeDView()->unsetCursor(); threeDWidget->threeDView()->unsetViewCursor();
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment