From 3b174d36eb9c035baae5bb9de6d20cd80f2d320b Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Fri, 10 Nov 2023 15:39:01 +0100 Subject: [PATCH] rm private fct --- GUI/View/PlotUtil/PlotEventHelper.cpp | 13 +++---------- GUI/View/PlotUtil/PlotEventHelper.h | 2 -- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/GUI/View/PlotUtil/PlotEventHelper.cpp b/GUI/View/PlotUtil/PlotEventHelper.cpp index 5ceb02dd64a..ed32df775e8 100644 --- a/GUI/View/PlotUtil/PlotEventHelper.cpp +++ b/GUI/View/PlotUtil/PlotEventHelper.cpp @@ -46,7 +46,9 @@ void PlotEventHelper::setMouseTrackingEnabled(bool enable) void PlotEventHelper::onCustomMouseMove(QMouseEvent* event) { - auto currentPos = currentPlotDescriptor(event); + double x = m_plot->customPlot()->xAxis->pixelToCoord(event->pos().x()); + double y = m_plot->customPlot()->yAxis->pixelToCoord(event->pos().y()); + PlotEventInfo currentPos = m_plot->eventInfo(x, y); if (currentPos.inAxesRange()) { m_plot->statusString(currentPos.infoString()); @@ -62,12 +64,3 @@ void PlotEventHelper::onCustomMouseMove(QMouseEvent* event) m_prevPos = currentPos; } - -//! Constructs current position of the data. - -PlotEventInfo PlotEventHelper::currentPlotDescriptor(QMouseEvent* event) const -{ - double x = m_plot->customPlot()->xAxis->pixelToCoord(event->pos().x()); - double y = m_plot->customPlot()->yAxis->pixelToCoord(event->pos().y()); - return m_plot->eventInfo(x, y); -} diff --git a/GUI/View/PlotUtil/PlotEventHelper.h b/GUI/View/PlotUtil/PlotEventHelper.h index e27f615be93..a4ae27cff82 100644 --- a/GUI/View/PlotUtil/PlotEventHelper.h +++ b/GUI/View/PlotUtil/PlotEventHelper.h @@ -43,8 +43,6 @@ public slots: void onCustomMouseMove(QMouseEvent* event); private: - PlotEventInfo currentPlotDescriptor(QMouseEvent* event) const; - ScientificPlot* m_plot; PlotEventInfo m_prevPos; }; -- GitLab