Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickcalendarmodel_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKCALENDARMODEL_P_H
6#define QQUICKCALENDARMODEL_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qabstractitemmodel.h>
20#include <QtCore/qdatetime.h>
21#include <QtQml/qqmlparserstatus.h>
22#include <QtQml/qqml.h>
23#include <QtCore/private/qglobal_p.h>
24
25QT_BEGIN_NAMESPACE
26
27class QQuickCalendarModelPrivate;
28
30{
31 Q_OBJECT
32 Q_INTERFACES(QQmlParserStatus)
38
39public:
40 explicit QQuickCalendarModel(QObject *parent = nullptr);
41
42 QDate from() const;
43 void setFrom(QDate from);
44
45 QDate to() const;
46 void setTo(QDate to);
47
48 Q_INVOKABLE int monthAt(int index) const;
49 Q_INVOKABLE int yearAt(int index) const;
50 Q_INVOKABLE int indexOf(QDate date) const;
51 Q_INVOKABLE int indexOf(int year, int month) const;
52
53 enum {
56 };
57
58 QHash<int, QByteArray> roleNames() const override;
59 QVariant data(const QModelIndex &index, int role) const override;
60 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
61
64 void toChanged();
66
67protected:
68 void classBegin() override;
70
71private:
74};
75
76QT_END_NAMESPACE
77
78#endif // QQUICKCALENDARMODEL_P_H
void populate(QDate from, QDate to, bool force=false)
Q_INVOKABLE int yearAt(int index) const
\qmlmethod int QtQuick.Controls::CalendarModel::yearAt(int index)
QDate to() const
\qmlproperty date QtQuick.Controls::CalendarModel::to
void classBegin() override
Invoked after class creation, but before any properties have been set.
Q_INVOKABLE int indexOf(int year, int month) const
\qmlmethod int QtQuick.Controls::CalendarModel::indexOf(int year, int month)
QDate from() const
\qmlproperty date QtQuick.Controls::CalendarModel::from
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
QVariant data(const QModelIndex &index, int role) const override
Returns the data stored under the given role for the item referred to by the index.
Q_INVOKABLE int indexOf(QDate date) const
\qmlmethod int QtQuick.Controls::CalendarModel::indexOf(Date date)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
QHash< int, QByteArray > roleNames() const override
Q_INVOKABLE int monthAt(int index) const
\qmlmethod int QtQuick.Controls::CalendarModel::monthAt(int index)