Use global event handler for tracking active plot window

This commit is contained in:
Jon Jenssen authored and JJ committed 2026-06-17 13:55:32 +02:00
1 parent ff4a54121f
commit 967975828c
3 files changed
+20 -10

No files matched your search

@@ -440,10 +440,11 @@ bool RimPlotWindow::handleGlobalWheelEvent( QWheelEvent* wheelEvent )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotWindow::onMousePressEvent( QMouseEvent* mouseEvent )
bool RimPlotWindow::handleGlobalMousePressEvent( QMouseEvent* mouseEvent )
{
if ( mouseEvent )
if ( mouseEvent && viewWidget() && viewWidget()->underMouse() )
{
setAsActiveViewer();
}
return false;
}
@@ -92,9 +92,7 @@ public:
virtual bool handleGlobalKeyEvent( QKeyEvent* keyEvent );
virtual bool handleGlobalWheelEvent( QWheelEvent* wheelEvent );
public slots:
void onMousePressEvent( QMouseEvent* event );
virtual bool handleGlobalMousePressEvent( QMouseEvent* mouseEvent );
protected:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;