diff options
author | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2018-09-28 15:23:47 +0200 |
---|---|---|
committer | Leena Miettinen <riitta-leena.miettinen@qt.io> | 2018-10-15 06:41:34 +0000 |
commit | 261e4c619214af5e5cf95ec08a7d46d702ae0a93 (patch) | |
tree | b670a6f347a8a8053bee850162c6ed542fcb5524 /src/networksettings/qnetworksettingsinterfacemodel.cpp | |
parent | 0ecd391912f6338d5aef6105600fc8c321c83bd8 (diff) |
Doc: Add documentation for C++ classes
Currently, only QML types are documented.
Task-number: QTBUG-69686
Change-Id: Idc13bff25a154e88c6c769c0af37204573ec1118
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
Diffstat (limited to 'src/networksettings/qnetworksettingsinterfacemodel.cpp')
-rw-r--r-- | src/networksettings/qnetworksettingsinterfacemodel.cpp | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/src/networksettings/qnetworksettingsinterfacemodel.cpp b/src/networksettings/qnetworksettingsinterfacemodel.cpp index 72ea805..ff234ac 100644 --- a/src/networksettings/qnetworksettingsinterfacemodel.cpp +++ b/src/networksettings/qnetworksettingsinterfacemodel.cpp @@ -31,6 +31,33 @@ QT_BEGIN_NAMESPACE +/*! + \class QNetworkSettingsInterfaceModel + \inmodule QtDeviceUtilities + \brief The QNetworkSettingsInterfaceModel class represents a network + interface model. + + The network interface model contains a list of network interfaces + attached to the host. +*/ + +/*! + \enum QNetworkSettingsInterfaceModel::Roles + \brief This enum type holds information about a network interface. + + \value Type + Network interface \l{QNetworkSettingsType::Types}{type}. + \value Status + Network interface \l{QNetworkSettingsState::States}{state}. + \value Name + Network interface name. + \value Powered + Whether the network interface is powered on or off. +*/ + +/*! + Creates a new network interface model with the parent \a parent. +*/ QNetworkSettingsInterfaceModel::QNetworkSettingsInterfaceModel(QObject *parent) : QAbstractListModel(parent) { @@ -41,18 +68,27 @@ QNetworkSettingsInterfaceModel::QNetworkSettingsInterfaceModel(QObject *parent) m_roleNames.insert(Powered, "powered"); } +/*! + Returns an array of the names of the roles in the model. +*/ QHash<int, QByteArray> QNetworkSettingsInterfaceModel::roleNames() const { return m_roleNames; } - +/*! + Returns the number of rows in the model with the parent \a parent. +*/ int QNetworkSettingsInterfaceModel::rowCount(const QModelIndex & parent) const { Q_UNUSED(parent); return m_items.count(); } +/*! + Returns the data at the index \a index in the model for the type of data + specified by \a role. +*/ QVariant QNetworkSettingsInterfaceModel::data(const QModelIndex & index, int role) const { if (!index.isValid()) return QVariant(); @@ -81,6 +117,9 @@ QVariant QNetworkSettingsInterfaceModel::data(const QModelIndex & index, int rol } +/*! + Appends \a item to the model. +*/ void QNetworkSettingsInterfaceModel::append(QNetworkSettingsInterface* item) { item->setParent(this); @@ -90,6 +129,9 @@ void QNetworkSettingsInterfaceModel::append(QNetworkSettingsInterface* item) endInsertRows(); } +/*! + Inserts \a item into \a row in the model. +*/ void QNetworkSettingsInterfaceModel::insert(int row, QNetworkSettingsInterface* item) { item->setParent(this); @@ -99,6 +141,9 @@ void QNetworkSettingsInterfaceModel::insert(int row, QNetworkSettingsInterface* endInsertRows(); } +/*! + Removes the row \a row from the model. +*/ void QNetworkSettingsInterfaceModel::remove(int row) { beginRemoveRows(QModelIndex(), row, row); @@ -106,6 +151,9 @@ void QNetworkSettingsInterfaceModel::remove(int row) endRemoveRows(); } +/*! + Returns the network interface model. +*/ QList<QNetworkSettingsInterface*> QNetworkSettingsInterfaceModel::getModel() { return m_items; |