KHolidays

holidayregionsmodel.h
1/*
2 This file is part of the kholidays library.
3
4 SPDX-FileCopyrightText: 2015 Martin Klapetek <mklapetek@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef HOLIDAYREGIONSMODEL_H
10#define HOLIDAYREGIONSMODEL_H
11
12#include <QAbstractTableModel>
13#include <QObject>
14
15class HolidayRegionsDeclarativeModel : public QAbstractTableModel
16{
18public:
19 enum Roles {
20 RegionRole = Qt::UserRole + 1,
21 NameRole,
22 DescriptionRole,
23 };
24 enum Columns { RegionColumn, NameColumn, DescriptionColumn };
25 explicit HolidayRegionsDeclarativeModel(QObject *parent = nullptr);
26 ~HolidayRegionsDeclarativeModel() override;
27
28 int columnCount(const QModelIndex &parent = QModelIndex()) const override;
29 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
30 QVariant data(const QModelIndex &index, int role) const override;
31 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
32 QHash<int, QByteArray> roleNames() const override;
33
34private:
35 class Private;
36 Private *const d;
37};
38
39#endif
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
Q_OBJECTQ_OBJECT
QObject * parent() const const
UserRole
Orientation
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.