1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QCANDLESTICKMODELMAPPER_H
5#define QCANDLESTICKMODELMAPPER_H
6
7#include <QtCharts/QChartGlobal>
8#include <QtCore/QObject>
9
10Q_MOC_INCLUDE(<QtCharts/qcandlestickseries.h>)
11Q_MOC_INCLUDE(<QtCore/qabstractitemmodel.h>)
12
13QT_BEGIN_NAMESPACE
14class QAbstractItemModel;
15QT_END_NAMESPACE
16
17QT_BEGIN_NAMESPACE
18
19class QCandlestickModelMapperPrivate;
20class QCandlestickSeries;
21
22class Q_CHARTS_EXPORT QCandlestickModelMapper : public QObject
23{
24 Q_OBJECT
25 Q_PROPERTY(QAbstractItemModel *model READ model WRITE setModel NOTIFY modelReplaced)
26 Q_PROPERTY(QCandlestickSeries *series READ series WRITE setSeries NOTIFY seriesReplaced)
27
28public:
29 explicit QCandlestickModelMapper(QObject *parent = nullptr);
30
31 void setModel(QAbstractItemModel *model);
32 QAbstractItemModel *model() const;
33
34 void setSeries(QCandlestickSeries *series);
35 QCandlestickSeries *series() const;
36
37 virtual Qt::Orientation orientation() const = 0;
38
39Q_SIGNALS:
40 void modelReplaced();
41 void seriesReplaced();
42
43protected:
44 void setTimestamp(int timestamp);
45 int timestamp() const;
46
47 void setOpen(int open);
48 int open() const;
49
50 void setHigh(int high);
51 int high() const;
52
53 void setLow(int low);
54 int low() const;
55
56 void setClose(int close);
57 int close() const;
58
59 void setFirstSetSection(int firstSetSection);
60 int firstSetSection() const;
61
62 void setLastSetSection(int lastSetSection);
63 int lastSetSection() const;
64
65protected:
66 QCandlestickModelMapperPrivate * const d_ptr;
67 Q_DECLARE_PRIVATE(QCandlestickModelMapper)
68};
69
70QT_END_NAMESPACE
71
72#endif // QCANDLESTICKMODELMAPPER_H
73

source code of qtcharts/src/charts/candlestickchart/qcandlestickmodelmapper.h