16 #include <QMouseEvent>
17 #include <qcustomplot.h>
20 : QObject(scientific_plot)
21 , m_plot(scientific_plot)
22 , m_prevPos(scientific_plot->plotType())
32 m_plot->setMouseTracking(enable);
36 connect(
customPlot(), &QCustomPlot::mouseMove,
this,
39 disconnect(
customPlot(), &QCustomPlot::mouseMove,
this,
51 if (currentPos.inAxesRange()) {
Defines class ScientificPlotEvent.
Contains parameters of mouse position in 1D or 2D plot.
~ScientificPlotEvent() override
ScientificPlot * scientificPlot()
void positionChanged(double x, double y)
PlotEventInfo currentPlotDescriptor(QMouseEvent *event) const
Constructs current position of the data.
void onCustomMouseMove(QMouseEvent *event)
Constructs status string on mouse move event coming from QCustomPlot. String is emitted if mouse is i...
ScientificPlotEvent(ScientificPlot *scientific_plot)
QCustomPlot * customPlot()
void setMouseTrackingEnabled(bool enable)
Sets tracking of the mouse for parent DescriptedPlot.
Common interface for plot-descriptor interaction.
virtual PlotEventInfo eventInfo(double xpos, double ypos) const =0
Returns plot descriptor corresponding to given axes coordinates.
void statusString(const QString &text)
virtual QCustomPlot * customPlot()=0
double pixelToYaxisCoord(double pixel) const
double pixelToXaxisCoord(double pixel) const
transform widget coordinates to axes coordinates