File indexing completed on 2023-10-03 07:06:00
0001 /* 0002 This file is part of the kholidays library. 0003 0004 SPDX-FileCopyrightText: 2015 Martin Klapetek <mklapetek@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #ifndef HOLIDAYREGIONSMODEL_H 0010 #define HOLIDAYREGIONSMODEL_H 0011 0012 #include <QAbstractTableModel> 0013 #include <QObject> 0014 0015 class HolidayRegionsDeclarativeModel : public QAbstractTableModel 0016 { 0017 Q_OBJECT 0018 public: 0019 enum Roles { 0020 RegionRole = Qt::UserRole + 1, 0021 NameRole, 0022 DescriptionRole, 0023 }; 0024 enum Columns { RegionColumn, NameColumn, DescriptionColumn }; 0025 explicit HolidayRegionsDeclarativeModel(QObject *parent = nullptr); 0026 ~HolidayRegionsDeclarativeModel() override; 0027 0028 int columnCount(const QModelIndex &parent = QModelIndex()) const override; 0029 int rowCount(const QModelIndex &parent = QModelIndex()) const override; 0030 QVariant data(const QModelIndex &index, int role) const override; 0031 QVariant headerData(int section, Qt::Orientation orientation, int role) const override; 0032 QHash<int, QByteArray> roleNames() const override; 0033 0034 private: 0035 class Private; 0036 Private *const d; 0037 }; 0038 0039 #endif