From 261e4c619214af5e5cf95ec08a7d46d702ae0a93 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Fri, 28 Sep 2018 15:23:47 +0200 Subject: Doc: Add documentation for C++ classes Currently, only QML types are documented. Task-number: QTBUG-69686 Change-Id: Idc13bff25a154e88c6c769c0af37204573ec1118 Reviewed-by: Leena Miettinen Reviewed-by: Teemu Holappa --- .../qnetworksettingsinterfacemodel.cpp | 50 +++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'src/networksettings/qnetworksettingsinterfacemodel.cpp') 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 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 QNetworkSettingsInterfaceModel::getModel() { return m_items; -- cgit v1.2.3