mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#466) Clicking a plot track selects the item in the project tree view
This commit is contained in:
parent
6b5aaecc80
commit
ce6c33fa09
@ -22,6 +22,10 @@
|
||||
#include "RimWellLogPlot.h"
|
||||
#include "RimWellLogPlotTrace.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafPdmUiTreeView.h"
|
||||
|
||||
#include "qwt_plot_grid.h"
|
||||
#include "qwt_legend.h"
|
||||
#include "qwt_scale_engine.h"
|
||||
@ -49,7 +53,8 @@ RiuWellLogTracePlot::RiuWellLogTracePlot(RimWellLogPlotTrace* plotTraceDefinitio
|
||||
|
||||
m_legend = new QwtLegend(this);
|
||||
insertLegend(m_legend, QwtPlot::TopLegend);
|
||||
|
||||
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
setDefaults();
|
||||
}
|
||||
|
||||
@ -189,3 +194,14 @@ bool RiuWellLogTracePlot::eventFilter(QObject* watched, QEvent* event)
|
||||
|
||||
return QwtPlot::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuWellLogTracePlot::focusInEvent(QFocusEvent* event)
|
||||
{
|
||||
if (m_plotTraceDefinition)
|
||||
{
|
||||
RiuMainWindow::instance()->projectTreeView()->selectAsCurrentItem(m_plotTraceDefinition);
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual bool eventFilter(QObject* watched, QEvent* event);
|
||||
virtual void focusInEvent(QFocusEvent* event);
|
||||
|
||||
private:
|
||||
void setDefaults();
|
||||
|
Loading…
Reference in New Issue
Block a user