TimezoneModel Class
The TimezoneModel class provides a model for the available time zones. More...
Header: | #include <TimezoneModel> |
qmake: | QT += timedatesettings |
Inherits: | QAbstractListModel |
Public Types
enum | Roles { Name, Country, Id } |
Public Functions
TimezoneModel(QObject *parent = Q_NULLPTR) | |
virtual | ~TimezoneModel() |
QList<TimezoneItem *> | getModel() const |
Reimplemented Public Functions
virtual QVariant | data(const QModelIndex &index, int role = Qt::DisplayRole) const |
virtual QHash<int, QByteArray> | roleNames() const |
virtual int | rowCount(const QModelIndex &parent = QModelIndex()) const |
- 4 public functions inherited from QAbstractListModel
- 40 public functions inherited from QAbstractItemModel
- 31 public functions inherited from QObject
Signals
void | ready() |
- 18 signals inherited from QAbstractItemModel
- 2 signals inherited from QObject
Static Public Members
void | generateModel(TimezoneModel *model) |
const QMetaObject | staticMetaObject |
- 9 static public members inherited from QObject
Additional Inherited Members
- 1 property inherited from QObject
- 2 public slots inherited from QAbstractItemModel
- 1 public slot inherited from QObject
- 19 protected functions inherited from QAbstractItemModel
- 9 protected functions inherited from QObject
- 1 protected slot inherited from QAbstractItemModel
Detailed Description
The TimezoneModel class provides a model for the available time zones.
This class can be used as the model in a view that lists the available time zones.
Member Type Documentation
enum TimezoneModel::Roles
This enum type holds information about a time zone.
Constant | Value | Description |
---|---|---|
TimezoneModel::Name | Qt::UserRole + 1 | Localized display name of the time zone |
TimezoneModel::Country | 258 | Name of the country for the time zone |
TimezoneModel::Id | 259 | IANA time zone ID |
Member Function Documentation
TimezoneModel::TimezoneModel(QObject *parent = Q_NULLPTR)
Creates a new time zone model with the parent parent.
[virtual]
TimezoneModel::~TimezoneModel()
Deletes the time zone model.
[virtual]
QVariant TimezoneModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const
Reimplemented from QAbstractItemModel::data().
Returns the data at the index index in the model for the type of data specified by role.
[static]
void TimezoneModel::generateModel(TimezoneModel *model)
Creates the time zone model model.
QList<TimezoneItem *> TimezoneModel::getModel() const
Returns the time zone model for a time zone item.
[signal]
void TimezoneModel::ready()
This signal is emitted when the model is ready.
[virtual]
QHash<int, QByteArray> TimezoneModel::roleNames() const
Reimplemented from QAbstractItemModel::roleNames().
Returns an array of the names of the roles in the model.
[virtual]
int TimezoneModel::rowCount(const QModelIndex &parent = QModelIndex()) const
Reimplemented from QAbstractItemModel::rowCount().
Returns the number of rows in the model with the parent parent.
© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.