Kirigami-addons
6#include <QAbstractItemModel>
10#include <QQmlParserStatus>
11#include <qqmlregistration.h>
21 Q_PROPERTY(
int datesToAdd READ datesToAdd WRITE setDatesToAdd NOTIFY datesToAddChanged)
22 Q_PROPERTY(
int scale READ scale WRITE setScale NOTIFY scaleChanged)
23 Q_PROPERTY(QDateTime currentDate READ currentDate WRITE setCurrentDate NOTIFY currentDateChanged)
24 Q_PROPERTY(QDateTime minimumDate READ minimumDate WRITE setMinimumDate NOTIFY minimumDateChanged)
25 Q_PROPERTY(QDateTime maximumDate READ maximumDate WRITE setMaximumDate NOTIFY maximumDateChanged)
29 enum Scale { WeekScale, MonthScale, YearScale, DecadeScale };
40 explicit InfiniteCalendarViewModel(
QObject *
parent =
nullptr);
41 ~InfiniteCalendarViewModel() =
default;
44 QVariant data(
const QModelIndex &idx,
int role)
const override;
45 QHash<int, QByteArray> roleNames()
const override;
46 int rowCount(
const QModelIndex &
parent = {})
const override;
48 void classBegin()
override;
49 void componentComplete()
override;
51 QDateTime currentDate()
const;
52 void setCurrentDate(
const QDateTime ¤tDate);
54 QDateTime minimumDate()
const;
55 void setMinimumDate(
const QDateTime &minimumDate);
57 QDateTime maximumDate()
const;
58 void setMaximumDate(
const QDateTime &maximumDate);
60 Q_INVOKABLE void addDates(
bool atEnd,
const QDateTime &startFrom = {});
62 int datesToAdd()
const;
63 void setDatesToAdd(
int datesToAdd);
66 void setScale(
int scale);
69 void datesToAddChanged();
71 void currentDateChanged();
72 void minimumDateChanged();
73 void maximumDateChanged();
76 void addWeekDates(
bool atEnd,
const QDateTime &startFrom);
77 void addMonthDates(
bool atEnd,
const QDateTime &startFrom);
78 void addYearDates(
bool atEnd,
const QDateTime &startFrom);
79 void addDecadeDates(
bool atEnd,
const QDateTime &startFrom);
81 QDateTime m_currentDate;
82 QDateTime m_minimumDate;
83 QDateTime m_maximumDate;
84 QVector<QDateTime> m_startDates;
85 QVector<QDateTime> m_firstDayOfMonthDates;
87 int m_datesToAdd = 10;
88 int m_scale = MonthScale;
89 bool m_isCompleted =
false;
virtual QModelIndex parent(const QModelIndex &index) const const=0
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:49:11 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.