camper/src/timelinedaymodel.h

39 lines
927 B
C++

#ifndef TIMELINEDAYMODEL_H
#define TIMELINEDAYMODEL_H
#include <QAbstractListModel>
#include <QtQmlIntegration>
class TimelineDayModel : public QAbstractListModel
{
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(QDate fromDate READ fromDate WRITE setFromDate NOTIFY fromDateChanged)
Q_PROPERTY(QDate toDate READ toDate WRITE setToDate NOTIFY toDateChanged)
public:
explicit TimelineDayModel(QObject *parent = nullptr);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QDate fromDate() const;
void setFromDate(QDate date);
QDate toDate() const;
void setToDate(QDate date);
signals:
void fromDateChanged(QDate date);
void toDateChanged(QDate date);
private:
Q_DISABLE_COPY_MOVE(TimelineDayModel)
QDate m_fromDate;
QDate m_toDate;
};
#endif // TIMELINEDAYMODEL_H