#ifndef __DATASTRUCTURE_H__ #define __DATASTRUCTURE_H__ #include #include struct NetworkInfomation { Q_GADGET QML_NAMED_ELEMENT(networkInfomation) Q_PROPERTY(bool dhcp MEMBER dhcp) Q_PROPERTY(QString ip MEMBER ip) Q_PROPERTY(QString netmask MEMBER netmask) Q_PROPERTY(QString gateway MEMBER gateway) Q_PROPERTY(QString dns MEMBER dns) public: bool dhcp; QString ip; QString netmask; QString gateway; QString dns = "8.8.8.8"; // dns被屏蔽,现在默认赋值 8.8.8.8 以通过校验 }; Q_DECLARE_METATYPE(NetworkInfomation) #endif // __DATASTRUCTURE_H__