summaryrefslogtreecommitdiffstats
path: root/src/networksettings/qnetworksettingsaddressmodel.cpp
diff options
context:
space:
mode:
authorLeena Miettinen <riitta-leena.miettinen@qt.io>2018-09-28 15:23:47 +0200
committerLeena Miettinen <riitta-leena.miettinen@qt.io>2018-10-15 06:41:34 +0000
commit261e4c619214af5e5cf95ec08a7d46d702ae0a93 (patch)
treeb670a6f347a8a8053bee850162c6ed542fcb5524 /src/networksettings/qnetworksettingsaddressmodel.cpp
parent0ecd391912f6338d5aef6105600fc8c321c83bd8 (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/qnetworksettingsaddressmodel.cpp')
-rw-r--r--src/networksettings/qnetworksettingsaddressmodel.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/networksettings/qnetworksettingsaddressmodel.cpp b/src/networksettings/qnetworksettingsaddressmodel.cpp
index d86318b..7872018 100644
--- a/src/networksettings/qnetworksettingsaddressmodel.cpp
+++ b/src/networksettings/qnetworksettingsaddressmodel.cpp
@@ -30,17 +30,49 @@
QT_BEGIN_NAMESPACE
+/*!
+ \class QNetworkSettingsAddressModel
+ \inmodule QtDeviceUtilities
+
+ \brief The QNetworkSettingsAddressModel class represents a network
+ interface address.
+
+ An address model contains a lists of available network interface addresses.
+
+ \sa QNetworkSettingsManager
+*/
+
+/*!
+ \property QNetworkSettingsAddressModel::count
+ \brief Holds the number of rows in the model.
+*/
+
+/*!
+ \fn QNetworkSettingsAddressModel::countChanged()
+ This signal is emitted when the number of rows in the model changes.
+*/
+
+/*!
+ Creates an address model with the parent \a parent.
+*/
QNetworkSettingsAddressModel::QNetworkSettingsAddressModel(QObject *parent)
:QStringListModel(parent)
{
}
+/*!
+ Creates an address model with the addresses specified by
+ \a strings and parent \a parent.
+*/
QNetworkSettingsAddressModel::QNetworkSettingsAddressModel(const QStringList &strings, QObject *parent)
:QStringListModel(parent)
{
setStringList(strings);
}
+/*!
+ Adds the addresses specified by \a addresses to the address model.
+*/
void QNetworkSettingsAddressModel::setStringList(const QStringList &addresses)
{
m_addresses = addresses;
@@ -48,6 +80,9 @@ void QNetworkSettingsAddressModel::setStringList(const QStringList &addresses)
emit countChanged();
}
+/*!
+ Adds the address specified by \a address to the address model.
+*/
void QNetworkSettingsAddressModel::append(const QString& address)
{
int row = rowCount();
@@ -61,17 +96,27 @@ void QNetworkSettingsAddressModel::append(const QString& address)
emit countChanged();
}
+/*!
+ Removes the address at the position specified by \a index from the address
+ model.
+*/
void QNetworkSettingsAddressModel::remove(int index)
{
removeRows(index, 1);
emit countChanged();
}
+/*!
+ Returns the number of rows in the address model.
+*/
int QNetworkSettingsAddressModel::count() const
{
return rowCount();
}
+/*!
+ Resets the changes made to the addresses in the address model.
+*/
void QNetworkSettingsAddressModel::resetChanges()
{
QStringListModel::setStringList(m_addresses);