summaryrefslogtreecommitdiffstats
path: root/examples/charts/chartsgallery/boxplotdatareader.h
diff options
context:
space:
mode:
Diffstat (limited to 'examples/charts/chartsgallery/boxplotdatareader.h')
-rw-r--r--examples/charts/chartsgallery/boxplotdatareader.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/charts/chartsgallery/boxplotdatareader.h b/examples/charts/chartsgallery/boxplotdatareader.h
new file mode 100644
index 00000000..253b05ee
--- /dev/null
+++ b/examples/charts/chartsgallery/boxplotdatareader.h
@@ -0,0 +1,29 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#ifndef BOXPLOTDATAREADER_H
+#define BOXPLOTDATAREADER_H
+
+#include <QList>
+#include <QTextStream>
+
+QT_FORWARD_DECLARE_CLASS(QBoxSet)
+
+class BoxPlotDataReader
+{
+public:
+ explicit BoxPlotDataReader(QIODevice *device);
+
+ QBoxSet *readBox();
+ void readFile(QIODevice *device);
+ bool atEnd() const;
+
+protected:
+ qreal findMedian(int begin, int end);
+
+private:
+ QList<qreal> m_sortedList;
+ QTextStream m_textStream;
+};
+
+#endif