IP address mask using TextInput

I am trying to create TextInputfor IP addresses and I need to manage ranges ( 0-255).

I used the validator regExpas well as inputMaskfrom "000.000.000.000;0", but it canceled the validator.

How to create an IP validation template with an input mask?

TextInput
{
  id: myLineEdit
  anchors.fill: parent
  cursorVisible: true
  focus: true

  validator:RegExpValidator
  {
    regExp:/^(([01]?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))\.){3}([01]?[0-9]?[0-9]|2([0-4][0-9]|5[0-5]))$/
  }

  inputMask:  "000.000.000.000;0"
}
+3
source share
1 answer

Skip input mask.

And you must define different components for both IPv4 and IPv6.

0
source

All Articles