#4220 Apply picking cursor only when over a 3d View

This commit is contained in:
Gaute Lindkvist committed 2019-03-25 15:15:20 +01:00
1 parent ef182da8a9
commit 44f3882ecb
5 files changed
+52 -10

No files matched your search

@@ -77,6 +77,8 @@ using cvf::ManipulatorTrackball;
const double RI_MIN_NEARPLANE_DISTANCE = 0.1;
std::unique_ptr<QCursor> RiuViewer::s_hoverCursor;
//==================================================================================================
///
/// \class RiuViewer
@@ -841,11 +843,24 @@ void RiuViewer::mouseMoveEvent(QMouseEvent* mouseEvent)
caf::Viewer::mouseMoveEvent(mouseEvent);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::enterEvent(QEvent*)
{
if (s_hoverCursor)
{
QApplication::setOverrideCursor(*s_hoverCursor);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::leaveEvent(QEvent*)
{
QApplication::restoreOverrideCursor();
if (m_rimView && m_rimView->assosiatedViewLinker())
{
RimViewLinker* viewLinker = m_rimView->assosiatedViewLinker();
@@ -1026,6 +1041,22 @@ void RiuViewer::showScaleLegend(bool show)
updateLegendLayout();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::setHoverCursor(const QCursor& cursor)
{
s_hoverCursor.reset(new QCursor(cursor));
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::clearHoverCursor()
{
s_hoverCursor.reset();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------