Preparations for #1321: Aligned default stuff between the plot types.

This commit is contained in:
Jacob Støren
2017-03-27 16:47:59 +02:00
parent a82677c743
commit c0ff734cc7
8 changed files with 111 additions and 181 deletions

View File

@@ -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);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------