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.
34 lines
770 B
34 lines
770 B
#ifndef NETWORKINTERFACE_H
|
|
#define NETWORKINTERFACE_H
|
|
|
|
#include <QObject>
|
|
#include <QNetworkInterface>
|
|
|
|
class NetworkInterface : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged FINAL)
|
|
Q_PROPERTY(QString address READ address WRITE setAddress NOTIFY addressChanged FINAL)
|
|
public:
|
|
explicit NetworkInterface(int interfaceIndex, QObject *parent = nullptr);
|
|
|
|
QString name() const;
|
|
void setName(const QString &newName);
|
|
|
|
QString address() const;
|
|
void setAddress(const QString &newAddress);
|
|
Q_INVOKABLE void shutdown();
|
|
signals:
|
|
void nameChanged();
|
|
void addressChanged();
|
|
|
|
private:
|
|
|
|
QNetworkInterface m_qni;
|
|
QString m_name;
|
|
QString m_address;
|
|
};
|
|
|
|
#endif // NETWORKINTERFACE_H
|