MailTransport::TransportModel Class
class MailTransport::TransportModelThe TransportModel class. More...
| Header: | #include <MailTransport/TransportModel> |
| CMake: | find_package(KPim6MailTransport REQUIRED)target_link_libraries(mytarget PRIVATE KPim6::MailTransport) |
| Inherits: | QAbstractListModel |
Public Functions
| TransportModel(QObject *parent = nullptr) | |
| virtual | ~TransportModel() override |
| int | indexOf(int transportId) const |
| void | setShowDefault(bool show) |
| int | transportId(int index) const |
Reimplemented Public Functions
| virtual int | columnCount(const QModelIndex &parent) const override |
| virtual QVariant | data(const QModelIndex &index, int role = Qt::DisplayRole) const override |
| virtual Qt::ItemFlags | flags(const QModelIndex &index) const override |
| virtual QVariant | headerData(int section, Qt::Orientation orientation, int role) const override |
| virtual QHash<int, QByteArray> | roleNames() const override |
| virtual int | rowCount(const QModelIndex &parent = QModelIndex()) const override |
| virtual bool | setData(const QModelIndex &index, const QVariant &value, int role) override |
Detailed Description
Author: Laurent Montel <montel@kde.org>
Member Function Documentation
[explicit] TransportModel::TransportModel(QObject *parent = nullptr)
Creates a new TransportModel with the specified parent object.
[override virtual noexcept] TransportModel::~TransportModel()
Destroys the TransportModel.
[override virtual] int TransportModel::columnCount(const QModelIndex &parent) const
Reimplements: QAbstractItemModel::columnCount(const QModelIndex &parent) const.
Returns the number of columns under the given parent.
[override virtual] QVariant TransportModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const
Reimplements: QAbstractItemModel::data(const QModelIndex &index, int role) const.
Returns the data for the item at the given index with the specified role.
See also setData().
[override virtual] Qt::ItemFlags TransportModel::flags(const QModelIndex &index) const
Reimplements: QAbstractListModel::flags(const QModelIndex &index) const.
Returns the item flags for the given index.
[override virtual] QVariant TransportModel::headerData(int section, Qt::Orientation orientation, int role) const
Reimplements: QAbstractItemModel::headerData(int section, Qt::Orientation orientation, int role) const.
Returns the header data for the given section, orientation and role.
int TransportModel::indexOf(int transportId) const
Returns the index of the transport with the given ID transportId.
[override virtual] QHash<int, QByteArray> TransportModel::roleNames() const
Reimplements: QAbstractItemModel::roleNames() const.
Returns role names for QtQuick applications
[override virtual] int TransportModel::rowCount(const QModelIndex &parent = QModelIndex()) const
Reimplements: QAbstractItemModel::rowCount(const QModelIndex &parent) const.
Returns the number of rows under the given parent.
[override virtual] bool TransportModel::setData(const QModelIndex &index, const QVariant &value, int role)
Reimplements: QAbstractItemModel::setData(const QModelIndex &index, const QVariant &value, int role).
Sets the data for the item at the given index with the specified value and role. Returns true if successful.
See also data().
void TransportModel::setShowDefault(bool show)
Shows or hides the default transport, according to show.
int TransportModel::transportId(int index) const
Returns the transport ID at the given index.