1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QCANDLESTICKSET_H
5#define QCANDLESTICKSET_H
6
7#include <QtCharts/qchartglobal.h>
8#include <QtGui/qbrush.h>
9#include <QtGui/qpen.h>
10#include <QtCore/qobject.h>
11
12QT_BEGIN_NAMESPACE
13
14class QCandlestickSetPrivate;
15
16class Q_CHARTS_EXPORT QCandlestickSet : public QObject
17{
18 Q_OBJECT
19 Q_PROPERTY(qreal timestamp READ timestamp WRITE setTimestamp NOTIFY timestampChanged)
20 Q_PROPERTY(qreal open READ open WRITE setOpen NOTIFY openChanged)
21 Q_PROPERTY(qreal high READ high WRITE setHigh NOTIFY highChanged)
22 Q_PROPERTY(qreal low READ low WRITE setLow NOTIFY lowChanged)
23 Q_PROPERTY(qreal close READ close WRITE setClose NOTIFY closeChanged)
24 Q_PROPERTY(QBrush brush READ brush WRITE setBrush NOTIFY brushChanged)
25 Q_PROPERTY(QPen pen READ pen WRITE setPen NOTIFY penChanged)
26
27public:
28 explicit QCandlestickSet(qreal timestamp = 0.0, QObject *parent = nullptr);
29 explicit QCandlestickSet(qreal open, qreal high, qreal low, qreal close, qreal timestamp = 0.0,
30 QObject *parent = nullptr);
31 virtual ~QCandlestickSet();
32
33 void setTimestamp(qreal timestamp);
34 qreal timestamp() const;
35
36 void setOpen(qreal open);
37 qreal open() const;
38
39 void setHigh(qreal high);
40 qreal high() const;
41
42 void setLow(qreal low);
43 qreal low() const;
44
45 void setClose(qreal close);
46 qreal close() const;
47
48 void setBrush(const QBrush &brush);
49 QBrush brush() const;
50
51 void setPen(const QPen &pen);
52 QPen pen() const;
53
54Q_SIGNALS:
55 void clicked();
56 void hovered(bool status);
57 void pressed();
58 void released();
59 void doubleClicked();
60 void timestampChanged();
61 void openChanged();
62 void highChanged();
63 void lowChanged();
64 void closeChanged();
65 void brushChanged();
66 void penChanged();
67
68private:
69 QScopedPointer<QCandlestickSetPrivate> d_ptr;
70 Q_DECLARE_PRIVATE(QCandlestickSet)
71 Q_DISABLE_COPY(QCandlestickSet)
72 friend class QCandlestickSeriesPrivate;
73};
74
75QT_END_NAMESPACE
76
77#endif // QCANDLESTICKSET_H
78

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