more flexible SetMaskInput

  • Hello,
    I would like to make a mask input in a line edit for an IP address. Most often I find the suggestion
    But if I enter an IP address like it would look like 192.168.0 .100 with two spaces in it.
    Is there a way to avoid that?
    I would appreciate any help! Thank you

  • Moderators

    use QRegExpValidator (Qt4) or QRegularExpressionValidator (Qt5)
    with the following regexp:


    or less accurate:


Log in to reply