1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUICKMONTHGRID_P_H
5#define QQUICKMONTHGRID_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuickTemplates2/private/qquickcontrol_p.h>
19
20QT_BEGIN_NAMESPACE
21
22class QQmlComponent;
23class QQuickMonthGridPrivate;
24
25class QQuickMonthGrid : public QQuickControl
26{
27 Q_OBJECT
28 Q_PROPERTY(int month READ month WRITE setMonth NOTIFY monthChanged FINAL)
29 Q_PROPERTY(int year READ year WRITE setYear NOTIFY yearChanged FINAL)
30 Q_PROPERTY(QVariant source READ source WRITE setSource NOTIFY sourceChanged FINAL)
31 Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL)
32 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
33 QML_NAMED_ELEMENT(AbstractMonthGrid)
34 QML_ADDED_IN_VERSION(6, 3)
35
36public:
37 explicit QQuickMonthGrid(QQuickItem *parent = nullptr);
38
39 int month() const;
40 void setMonth(int month);
41
42 int year() const;
43 void setYear(int year);
44
45 QVariant source() const;
46 void setSource(const QVariant &source);
47
48 QString title() const;
49 void setTitle(const QString &title);
50
51 QQmlComponent *delegate() const;
52 void setDelegate(QQmlComponent *delegate);
53
54Q_SIGNALS:
55 void monthChanged();
56 void yearChanged();
57 void sourceChanged();
58 void titleChanged();
59 void delegateChanged();
60
61 void pressed(const QDate &date);
62 void released(const QDate &date);
63 void clicked(const QDate &date);
64 void pressAndHold(const QDate &date);
65
66protected:
67 void componentComplete() override;
68 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
69 void localeChange(const QLocale &newLocale, const QLocale &oldLocale) override;
70 void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding) override;
71 void updatePolish() override;
72
73 void timerEvent(QTimerEvent *event) override;
74
75private:
76 Q_DISABLE_COPY(QQuickMonthGrid)
77 Q_DECLARE_PRIVATE(QQuickMonthGrid)
78};
79
80QT_END_NAMESPACE
81
82QML_DECLARE_TYPE(QQuickMonthGrid)
83
84#endif // QQUICKMONTHGRID_P_H
85

source code of qtdeclarative/src/quicktemplates/qquickmonthgrid_p.h