CAM_Settings.qml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import QtQuick 2.5
  2. import QtQuick.Controls 1.4
  3. import QtQuick.Layouts 1.0
  4. import "qrc:/Globals"
  5. Rectangle {
  6. property string cam1URL: settings.value("CAM1SETTINGS/IpAddress", "0.0.0.0")
  7. property string cam2URL: settings.value("CAM2SETTINGS/IpAddress", "0.0.0.0")
  8. property int textFontSize: 22 //Pixelsize
  9. id: root
  10. width: parent.width
  11. height: parent.height
  12. color: "white"
  13. Flickable {
  14. id: flickable
  15. anchors.fill: parent
  16. contentWidth: content.width
  17. contentHeight: content.height
  18. interactive: contentHeight > height
  19. flickableDirection: Flickable.VerticalFlick
  20. Item {
  21. id: content
  22. x: 0
  23. y: 0
  24. width: flickable.width
  25. //============================================================================
  26. Label {
  27. id: lab1
  28. x: cam1IP.posX
  29. y: 100 + (textFontSize + 10) * 0
  30. font.pixelSize: textFontSize
  31. text: "URL 1 :"
  32. }
  33. UrlInput {
  34. id: cam1IP
  35. posX: 0
  36. posY: 100 + (textFontSize + 10) * 1
  37. urlwidth: parent.width
  38. urlcolor: "black"
  39. urlFontSize: textFontSize
  40. Component.onCompleted: {
  41. url = cam1URL;
  42. urlFocus = 0;
  43. }
  44. onKeyReturnPressed: {
  45. settings.setValue("CAM1SETTINGS/IpAddress", url);
  46. cam1URL = url;
  47. }
  48. }
  49. Label {
  50. id: lab2
  51. x: cam2IP.posX
  52. y: 100 + (textFontSize + 10) * 2
  53. font.pixelSize: textFontSize
  54. text: "URL 2 :"
  55. }
  56. UrlInput {
  57. id: cam2IP
  58. posX: 0
  59. posY: 100 + (textFontSize + 10) * 3
  60. urlwidth: parent.width
  61. urlcolor: "black"
  62. urlFontSize: textFontSize
  63. Component.onCompleted: {
  64. url = cam2URL;
  65. urlFocus = 0;
  66. }
  67. onKeyReturnPressed: {
  68. settings.setValue("CAM2SETTINGS/IpAddress", url);
  69. cam2URL = url;
  70. }
  71. }
  72. //============================================================================
  73. }
  74. }
  75. }