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

Signals

void ready()

Static Public Members

void generateModel(TimezoneModel *model)
const QMetaObject staticMetaObject
  • 9 static public members inherited from QObject

Additional Inherited Members

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.

ConstantValueDescription
TimezoneModel::NameQt::UserRole + 1Localized display name of the time zone
TimezoneModel::Country258Name of the country for the time zone
TimezoneModel::Id259IANA 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.

© 2019 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.