blob: 98faf8b4d9fb13895f7db87e30b99cfcec38a697 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef XYSERIESIODEVICE_H
#define XYSERIESIODEVICE_H
#include <QtCore/QIODevice>
#include <QtCore/QPointF>
#include <QtCore/QList>
#include <QtCharts/QChartGlobal>
QT_BEGIN_NAMESPACE
class QXYSeries;
QT_END_NAMESPACE
QT_USE_NAMESPACE
class XYSeriesIODevice : public QIODevice
{
Q_OBJECT
public:
explicit XYSeriesIODevice(QXYSeries *series, QObject *parent = nullptr);
static const int sampleCount = 2000;
protected:
qint64 readData(char *data, qint64 maxSize) override;
qint64 writeData(const char *data, qint64 maxSize) override;
private:
QXYSeries *m_series;
QList<QPointF> m_buffer;
};
#endif // XYSERIESIODEVICE_H
|