mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4220 Apply picking cursor only when over a 3d View
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user