Kirigami-addons

yearmodel.h
1/*
2 * SPDX-FileCopyrightText: 2019 David Edmundson <davidedmundson@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#pragma once
8
9#include <QAbstractListModel>
10#include <qqmlregistration.h>
11
12/// Display the number of months in a year.
14{
16 QML_ELEMENT
17
18 Q_PROPERTY(int year READ year WRITE setYear NOTIFY yearChanged)
19
20public:
21 explicit YearModel(QObject *parent = nullptr);
22 ~YearModel();
23
24 int year() const;
25 void setYear(int year);
26
27 int rowCount(const QModelIndex &parent) const override;
28 QVariant data(const QModelIndex &index, int role) const override;
29
31 void yearChanged();
32
33private:
34 int m_year;
35};
Display the number of months in a year.
Definition yearmodel.h:14
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:05:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.