6import QGroundControl.Controls
10 rowSpacing: _rowSpacing
11 columnSpacing: _colSpacing
13 function saveSettings() {
14 subEditConfig.host = hostField.text.trim()
15 subEditConfig.port = parseInt(portField.text)
18 QGCLabel { text: qsTr("Server Address") }
21 Layout.preferredWidth: _secondColumnWidth
22 text: subEditConfig.host
23 placeholderText: qsTr("localhost or 192.168.1.1")
25 // Allow IPv4, IPv6, hostnames, and domain names
26 // This is permissive - actual validation happens at connection time
27 validator: RegularExpressionValidator {
28 // Allow alphanumeric, dots, colons, hyphens, and brackets (for IPv6)
29 regularExpression: /^[a-zA-Z0-9\.\-:\[\]]+$/
33 QGCLabel { text: qsTr("Port") }
36 Layout.preferredWidth: _secondColumnWidth
37 text: subEditConfig.port.toString()
38 inputMethodHints: Qt.ImhFormattedNumbersOnly
39 placeholderText: qsTr("5760")
41 validator: IntValidator {
50 Layout.preferredWidth: _secondColumnWidth
51 Layout.fillWidth: true
52 font.pointSize: ScreenTools.smallFontPointSize
53 wrapMode: Text.WordWrap
54 text: qsTr("You can enter an IP address (e.g. 192.168.1.1) or hostname (e.g. my-drone.local)")