MauiKit Calendar

timezonelistmodel.h
1// SPDX-FileCopyrightText: 2021 Claudio Cambra <claudio.cambra@gmail.com>
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <QAbstractListModel>
7#include <QVector>
8#include <QQmlEngine>
9
10class TimeZoneListModel : public QAbstractListModel
11{
13 QML_ELEMENT
14public:
15 enum Roles { IdRole = Qt::UserRole + 1 };
16 Q_ENUM(Roles);
17
18 explicit TimeZoneListModel(QObject *parent = nullptr);
19 ~TimeZoneListModel() override = default;
20
21 QVariant data(const QModelIndex &idx, int role) const override;
22 QHash<int, QByteArray> roleNames() const override;
23 int rowCount(const QModelIndex &parent = {}) const override;
24
25 Q_INVOKABLE int getTimeZoneRow(const QByteArray &timeZone);
26
27private:
28 QVector<QByteArray> m_timeZones;
29};
Q_INVOKABLEQ_INVOKABLE
Q_OBJECTQ_OBJECT
QObject * parent() const const
UserRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:37 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.