import QtQuick 2.5 import QtQuick.Controls 1.4 import QtQuick.Layouts 1.0 ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") SetNetworkInterface { id: setEth0 mode: "static" ifacename: "eth0" address: "192.168.0.126" netmask: "255.255.255.0" nameserver: "192.168.0.101" gateway: "192.168.0.10" // infile: "/home/ru/BUILD/QT562_di-soric/GfA/board/GfA/Display001/rootfs/etc/network/interfaces" // outfile: "/root/out.txt" infile: "/home/ru/IFACE/interfaces" outfile: "/home/ru/IFACE/interfaces" onAddressChanged: { ipAddress.ipAddress = address; } } Button { x:10 y:10 height: 40 width:120 text: "Eth0 static" onClicked: { setEth0.mode = "static"; setEth0.doSetInterface(); } } Button { x:10 y:80 height: 40 width:120 text: "Eth0 dhcp" onClicked: { setEth0.mode = "dhcp"; setEth0.doSetInterface(); } } Button { x:10 y:150 height: 40 width:120 text: "restart Netw." onClicked: { //setEth0.doRestartNetwork(); setEth0.doGetInterface(); } } Label { x:500 y:220 text: ipAddress.ipAddress } Label { x:500 y:240 text: ipNetmask.ipAddress } IpAddressInput { id: ipAddress posX: 20 posY: 220 ipwidth: 200 ipcolor: "black" ipAddress: setEth0.address ipFontSize: 20 Component.onCompleted: { setEth0.doGetInterface(); } onIpAddressChanged: { setEth0.address = ipAddress.ipAddress; } } IpAddressInput { id: ipNetmask posX: 20 posY: 240 ipwidth: 200 ipcolor: "black" ipAddress: setEth0.netmask ipFontSize: 20 Component.onCompleted: { setEth0.doGetInterface(); } onIpAddressChanged: { setEth0.netmask = ipNetmask.ipAddress; } } }