main.qml 983 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import QtQuick 2.5
  2. import QtQuick.Controls 1.4
  3. import QtQuick.Layouts 1.0
  4. import ApplicationLauncher 1.0
  5. import "."
  6. ApplicationWindow {
  7. visible: true
  8. width: 640
  9. height: 480
  10. title: qsTr("Hello World")
  11. SetNetworkInterface {
  12. id: setEth0
  13. mode: "static"
  14. ifacename: "eth0"
  15. address: "192.168.0.233"
  16. netmask: "255.255.255.0"
  17. gateway: "192.168.0.123"
  18. infile: "/home/ru/BUILD/QT562_di-soric/GfA/board/GfA/Display001/rootfs/etc/network/interfaces"
  19. outfile: "/home/ru/out.txt"
  20. }
  21. Button {
  22. x:10
  23. y:10
  24. height: 40
  25. width:120
  26. text: "Eth0 static"
  27. onClicked: {
  28. setEth0.mode = "static";
  29. setEth0.doSetInterface();
  30. }
  31. }
  32. Button {
  33. x:10
  34. y:80
  35. height: 40
  36. width:120
  37. text: "Eth0 dhcp"
  38. onClicked: {
  39. setEth0.mode = "dhcp";
  40. setEth0.doSetInterface();
  41. }
  42. }
  43. }