You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
477 B
23 lines
477 B
#include "networkinterface.h"
|
|
#include <QNetworkInterface>
|
|
|
|
NetworkInterface::NetworkInterface(int interfaceIndex, QObject *parent)
|
|
: QObject{parent}
|
|
{
|
|
QNetworkInterface qni{QNetworkInterface::interfaceFromIndex(interfaceIndex)};
|
|
setName(qni.name());
|
|
}
|
|
|
|
QString NetworkInterface::name() const
|
|
{
|
|
return m_name;
|
|
}
|
|
|
|
void NetworkInterface::setName(const QString &newName)
|
|
{
|
|
if (m_name == newName)
|
|
return;
|
|
m_name = newName;
|
|
emit nameChanged();
|
|
}
|