1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QDATETIMEAXIS_H
5#define QDATETIMEAXIS_H
6
7#include <QtCharts/QAbstractAxis>
8
9QT_BEGIN_NAMESPACE
10class QDateTime;
11QT_END_NAMESPACE
12
13QT_BEGIN_NAMESPACE
14
15class QDateTimeAxisPrivate;
16
17class Q_CHARTS_EXPORT QDateTimeAxis : public QAbstractAxis
18{
19 Q_OBJECT
20 Q_PROPERTY(int tickCount READ tickCount WRITE setTickCount NOTIFY tickCountChanged)
21 Q_PROPERTY(QDateTime min READ min WRITE setMin NOTIFY minChanged)
22 Q_PROPERTY(QDateTime max READ max WRITE setMax NOTIFY maxChanged)
23 Q_PROPERTY(QString format READ format WRITE setFormat NOTIFY formatChanged)
24
25public:
26 explicit QDateTimeAxis(QObject *parent = nullptr);
27 ~QDateTimeAxis();
28
29protected:
30 QDateTimeAxis(QDateTimeAxisPrivate &d, QObject *parent = nullptr);
31
32public:
33 AxisType type() const override;
34
35 //range handling
36 void setMin(QDateTime min);
37 QDateTime min() const;
38 void setMax(QDateTime max);
39 QDateTime max() const;
40 void setRange(QDateTime min, QDateTime max);
41
42 void setFormat(QString format);
43 QString format() const;
44
45 //ticks handling
46 void setTickCount(int count);
47 int tickCount() const;
48
49Q_SIGNALS:
50 void minChanged(QDateTime min);
51 void maxChanged(QDateTime max);
52 void rangeChanged(QDateTime min, QDateTime max);
53 void formatChanged(QString format);
54 void tickCountChanged(int tick);
55
56private:
57 Q_DECLARE_PRIVATE(QDateTimeAxis)
58 Q_DISABLE_COPY(QDateTimeAxis)
59};
60
61QT_END_NAMESPACE
62
63#endif // QDATETIMEAXIS_H
64

source code of qtcharts/src/charts/axis/datetimeaxis/qdatetimeaxis.h