IpPopupForm.ui.qml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import QtQuick 2.4
  2. import QtQuick.Controls 2.3
  3. import QtQuick.Layouts 1.3
  4. Popup {
  5. id: popup
  6. height: 200
  7. dim: true
  8. clip: false
  9. width: 400
  10. modal: true
  11. focus: true
  12. closePolicy: Popup.NoAutoClose
  13. ColumnLayout {
  14. anchors.fill: parent
  15. Text {
  16. Layout.alignment: Qt.AlignCenter
  17. id: popupText
  18. color: "#ffffff"
  19. text: qsTr("Enter the IP to connect:")
  20. horizontalAlignment: Text.AlignHCenter
  21. verticalAlignment: Text.AlignVCenter
  22. font.pixelSize: 20
  23. }
  24. TextField {
  25. Layout.alignment: Qt.AlignCenter
  26. id: popupIpInput
  27. text: qsTr("")
  28. placeholderText: "Enter IP"
  29. horizontalAlignment: Text.AlignHCenter
  30. validator: RegExpValidator {
  31. regExp: /^(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))\.(\d|[1-9]\d|1\d\d|2([0-4]\d|5[0-5]))$/
  32. }
  33. }
  34. Text {
  35. id: popupStatusText
  36. color: "#df3f3f"
  37. text: qsTr("Text field for status")
  38. horizontalAlignment: Text.AlignHCenter
  39. verticalAlignment: Text.AlignVCenter
  40. Layout.alignment: Qt.AlignCenter
  41. font.pixelSize: 20
  42. }
  43. Button {
  44. Layout.alignment: Qt.AlignCenter
  45. id: popupConnectButton
  46. text: qsTr("Connect")
  47. enabled: popupIpInput.acceptableInput
  48. font.pointSize: 16
  49. // @disable-check M223
  50. onClicked: {
  51. // @disable-check M222
  52. _qmlHandler.onIpPopupEnterIp(popupIpInput.text)
  53. // @disable-check M222
  54. popup.close()
  55. }
  56. }
  57. }
  58. }