mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Preparations for #1321: Aligned default stuff between the plot types.
This commit is contained in:
@@ -23,12 +23,14 @@
|
||||
|
||||
#include "qwt_plot_curve.h"
|
||||
#include "qwt_date_scale_draw.h"
|
||||
#include <QEvent>
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuQwtCurvePointTracker::RiuQwtCurvePointTracker(QwtPlot* plot, bool isMainAxisHorizontal): QwtPlotPicker(plot->canvas()), m_plot(plot), m_isMainAxisHorizontal(isMainAxisHorizontal)
|
||||
RiuQwtCurvePointTracker::RiuQwtCurvePointTracker(QwtPlot* plot, bool isMainAxisHorizontal)
|
||||
: QwtPlotPicker(plot->canvas()), m_plot(plot), m_isMainAxisHorizontal(isMainAxisHorizontal)
|
||||
{
|
||||
this->setTrackerMode(QwtPicker::AlwaysOn);
|
||||
m_plotMarker = new QwtPlotMarker;
|
||||
@@ -60,6 +62,20 @@ void RiuQwtCurvePointTracker::removeMarkerOnFocusLeave()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiuQwtCurvePointTracker::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if ( event->type() == QEvent::Leave )
|
||||
{
|
||||
this->removeMarkerOnFocusLeave();
|
||||
}
|
||||
|
||||
// pass the event on to the parent class
|
||||
return QwtPlotPicker::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user