6#include <QtCore/private/qabstractitemmodel_p.h>
9 static const int daysInAWeek = 7;
10 static const int weeksOnACalendarMonth = 6;
11 static const int daysOnACalendarMonth = daysInAWeek * weeksOnACalendarMonth;
45 QDate firstDayOfMonthDate(
y,
m, 1);
51 QDate firstDateToDisplay = firstDayOfMonthDate.
addDays(-difference);
54 for (
int i = 0;
i < daysOnACalendarMonth; ++
i)
66 d->populate(
d->month,
d->year,
d->locale,
true);
79 if (
d->populate(
month,
d->year,
d->locale))
95 if (
d->year !=
year) {
96 if (
d->populate(
d->month,
year,
d->locale))
113 if (
d->populate(
d->month,
d->year,
locale))
138 return d->dates.value(
index);
144 if (date < d->dates.first() ||
date >
d->dates.last())
152 if (
index.isValid() &&
index.row() < daysOnACalendarMonth) {
160 return date ==
d->today;
178 return daysOnACalendarMonth;
195#include "moc_qquickmonthmodel_p.cpp"
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles=QList< int >())
This signal is emitted whenever the data in an existing item changes.
QObject * parent() const
Returns a pointer to the parent object.
\inmodule QtCore \reentrant
int weekNumber(int *yearNum=nullptr) const
Returns the ISO 8601 week number (1 to 53).
int month() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
int day() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QDate addDays(qint64 days) const
Returns a QDate object containing a date ndays later than the date of this object (or earlier if nday...
int year() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QDate currentDate()
Returns the system clock's current date.
int dayOfWeek() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Qt::DayOfWeek firstDayOfWeek() const
QString standaloneMonthName(int, FormatType format=LongFormat) const
QQuickMonthModelPrivate()
bool populate(int month, int year, const QLocale &locale, bool force=false)
Q_INVOKABLE QDate dateAt(int index) const
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
Q_INVOKABLE int indexOf(const QDate &date) const
void setLocale(const QLocale &locale)
QQuickMonthModel(QObject *parent=nullptr)
void setTitle(const QString &title)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Combined button and popup list for selecting options.
#define QByteArrayLiteral(str)
constexpr const T & qMax(const T &a, const T &b)
GLdouble GLdouble GLdouble GLdouble q
#define QStringLiteral(str)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent