diff --git a/GUI/View/PlotUtil/PlotEventInfo.cpp b/GUI/View/PlotUtil/PlotEventInfo.cpp index 8132264a00fb881aa24bf1add0e4985f40d209ce..fe12f5fa7a1d9f095cc47921c27fa5ec54d9938d 100644 --- a/GUI/View/PlotUtil/PlotEventInfo.cpp +++ b/GUI/View/PlotUtil/PlotEventInfo.cpp @@ -29,23 +29,21 @@ PlotEventInfo::PlotEventInfo(PLOT_TYPE type) QString PlotEventInfo::statusString() const { - if (m_info_type == PLOT_TYPE::Plot1D) + if (m_info_type == PLOT_TYPE::Plot1D) { + QString intensityString = QString::fromStdString(Py::Fmt::printScientificDouble(m_value)); return QString(" [x: %1, y: %2] [binx: %3]") .arg(QString::number(x(), 'f', 4)) - .arg(valueToString()) + .arg(intensityString) .arg(m_nx, 2); - else + } else { + QString intensityString = m_log_valued_axis + ? QString::fromStdString(Py::Fmt::printScientificDouble(m_value)) + : QString::number(m_value, 'f', 2); return QString(" [x: %1, y: %2] [binx: %3, biny:%4] [value: %5]") .arg(QString::number(x(), 'f', 4)) .arg(QString::number(y(), 'f', 4), 2) .arg(m_nx, 2) .arg(m_ny, 2) - .arg(valueToString()); -} - -QString PlotEventInfo::valueToString() const -{ - return m_info_type == PLOT_TYPE::Plot1D || m_log_valued_axis - ? QString::fromStdString(Py::Fmt::printScientificDouble(m_value)) - : QString::number(m_value, 'f', 2); + .arg(intensityString); + } } diff --git a/GUI/View/PlotUtil/PlotEventInfo.h b/GUI/View/PlotUtil/PlotEventInfo.h index 2f364914d20e88523897c05b386ad5dd658c40d6..fd3e9b95c4da4db0541b4ea61df29fe72575a354 100644 --- a/GUI/View/PlotUtil/PlotEventInfo.h +++ b/GUI/View/PlotUtil/PlotEventInfo.h @@ -49,8 +49,6 @@ public: int ny() const { return m_ny; } private: - QString valueToString() const; - bool m_in_axes_range, m_log_valued_axis; double m_x, m_y, m_value; int m_nx, m_ny;