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
qquickmonthmodel_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 QQUICKMONTHMODEL_P_H
6#define QQUICKMONTHMODEL_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 <QtCore/qlocale.h>
22#include <QtQml/qqml.h>
23#include <QtCore/private/qglobal_p.h>
24
26
28
30{
31 Q_OBJECT
32 Q_PROPERTY(int month READ month WRITE setMonth NOTIFY monthChanged FINAL)
37
38public:
39 explicit QQuickMonthModel(QObject *parent = nullptr);
40
41 int month() const;
42 void setMonth(int month);
43
44 int year() const;
45 void setYear(int year);
46
47 QLocale locale() const;
48 void setLocale(const QLocale &locale);
49
50 QString title() const;
51 void setTitle(const QString &title);
52
53 Q_INVOKABLE QDateTime dateAt(int index) const;
54 Q_INVOKABLE int indexOf(QDateTime date) const;
55
56 enum {
57 DateRole = Qt::UserRole + 1,
63 };
64
65 QHash<int, QByteArray> roleNames() const override;
66 QVariant data(const QModelIndex &index, int role) const override;
67 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
68
74
75private:
78};
79
80QT_END_NAMESPACE
81
82#endif // QQUICKMONTHMODEL_P_H
A grid of days for a calendar month.
bool handleRelease(const QPointF &point, ulong timestamp) override
bool handlePress(const QPointF &point, ulong timestamp) override
QQuickMonthModel * model
QQuickItem * cellAt(const QPointF &pos) const
QDateTime dateOf(QQuickItem *cell) const
bool handleMove(const QPointF &point, ulong timestamp) override
void clearPress(bool clicked)
void updatePress(const QPointF &pos)
void clicked(QDateTime date)
void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding) override
void localeChange(const QLocale &newLocale, const QLocale &oldLocale) override
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
int month() const
\qmlproperty int QtQuick.Controls::MonthGrid::month
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
void setTitle(const QString &title)
void timerEvent(QTimerEvent *event) override
This event handler can be reimplemented in a subclass to receive timer events for the object.
QQmlComponent * delegate() const
\qmlproperty Component QtQuick.Controls::MonthGrid::delegate
void setSource(const QVariant &source)
void setDelegate(QQmlComponent *delegate)
QString title() const
\qmlproperty string QtQuick.Controls::MonthGrid::title
void pressAndHold(QDateTime date)
void delegateChanged()
void setMonth(int month)
void updatePolish() override
This function should perform any layout as required for this item.
QVariant source() const
void sourceChanged()
void setYear(int year)
void pressed(QDateTime date)
int year() const
\qmlproperty int QtQuick.Controls::MonthGrid::year
void released(QDateTime date)
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.
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
QHash< int, QByteArray > roleNames() const override
void setMonth(int month)
QString title() const
void setYear(int year)
void setLocale(const QLocale &locale)
Q_INVOKABLE int indexOf(QDateTime date) const
void setTitle(const QString &title)
QLocale locale() const