Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QQUICKCALENDARMODEL_P_H
5#define QQUICKCALENDARMODEL_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 <QtCore/qabstractitemmodel.h>
19#include <QtCore/qdatetime.h>
20#include <QtQml/qqmlparserstatus.h>
21#include <QtQml/qqml.h>
22#include <QtCore/private/qglobal_p.h>
23
25
27
29{
32 Q_PROPERTY(QDate from READ from WRITE setFrom NOTIFY fromChanged FINAL)
33 Q_PROPERTY(QDate to READ to WRITE setTo NOTIFY toChanged FINAL)
35 QML_NAMED_ELEMENT(CalendarModel)
37
38public:
40
41 QDate from() const;
42 void setFrom(QDate from);
43
44 QDate to() const;
45 void setTo(QDate to);
46
47 Q_INVOKABLE int monthAt(int index) const;
48 Q_INVOKABLE int yearAt(int index) const;
49 Q_INVOKABLE int indexOf(QDate date) const;
50 Q_INVOKABLE int indexOf(int year, int month) const;
51
52 enum {
55 };
56
57 QHash<int, QByteArray> roleNames() const override;
58 QVariant data(const QModelIndex &index, int role) const override;
59 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
60
63 void toChanged();
65
66protected:
67 void classBegin() override;
68 void componentComplete() override;
69
70private:
71 Q_DISABLE_COPY(QQuickCalendarModel)
72 Q_DECLARE_PRIVATE(QQuickCalendarModel)
73};
74
76
77#endif // QQUICKCALENDARMODEL_P_H
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore \reentrant
Definition qdatetime.h:29
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
The QQmlParserStatus class provides updates on the QML parser state.
Q_INVOKABLE int yearAt(int index) const
\qmlmethod int QtQuick.Controls::CalendarModel::yearAt(int index)
void classBegin() override
Invoked after class creation, but before any properties have been set.
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
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)
\inmodule QtCore
Definition qvariant.h:65
QDate date
[1]
Combined button and popup list for selecting options.
GLuint index
[2]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_INTERFACES(x)
#define Q_SIGNALS
#define explicit