diff options
author | dodoradio <dodoradio@outlook.com> | 2023-07-22 16:28:44 +0100 |
---|---|---|
committer | dodoradio <dodoradio@outlook.com> | 2023-08-02 22:54:43 +0100 |
commit | dd8480cb8985d91d2cd99ca4741a4d8789eec700 (patch) | |
tree | ed857eacb87a471da07875925494f18a8a832b28 /src | |
parent | 80477423d8468439721092bdef6e277efd3bcce8 (diff) |
lineGraph: add support for floating point values
It seems that floats weren't previously supported due to a programming error on my part
Diffstat (limited to '')
-rw-r--r-- | src/cpp/lineGraph.cpp | 8 | ||||
-rw-r--r-- | src/cpp/lineGraph.h | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/cpp/lineGraph.cpp b/src/cpp/lineGraph.cpp index 7e013be..36171b9 100644 --- a/src/cpp/lineGraph.cpp +++ b/src/cpp/lineGraph.cpp @@ -83,13 +83,13 @@ void LineGraph::loadGraphData(QVariant fileDataInput) { return; } int j = fileDataAsList.count(); - minTime = fileDataAsList[0].toPoint().x(); - maxTime = fileDataAsList[j-1].toPoint().x(); - minValue = fileDataAsList[0].toPoint().y(); + minTime = fileDataAsList[0].toPointF().x(); + maxTime = fileDataAsList[j-1].toPointF().x(); + minValue = fileDataAsList[0].toPointF().y(); maxValue = minValue; m_filedata.clear(); for(int i = 0; i < j; i++) { - m_filedata.append(fileDataAsList[i].toPoint()); + m_filedata.append(fileDataAsList[i].toPointF()); if (minValue > m_filedata[i].y()) minValue = m_filedata[i].y(); if (maxValue < m_filedata[i].y()) maxValue = m_filedata[i].y(); } diff --git a/src/cpp/lineGraph.h b/src/cpp/lineGraph.h index 4ee4655..f6a592c 100644 --- a/src/cpp/lineGraph.h +++ b/src/cpp/lineGraph.h @@ -76,8 +76,8 @@ private: QColor m_color = QColor(255,255,255); QPixmap m_pixmap; QList<QPointF> m_filedata; - int minValue = 0; - int maxValue = 0; + float minValue = 0; + float maxValue = 0; int minTime; int maxTime; bool graphRelative; |