Quote Originally Posted by Jimmy2775 View Post
I think you could do it with the combination of a masked line edit, and a QRegExpValidator that checks for a regex like this: (?:1\d?\d?|2(?:[0-4]\d?|[6789]|5[0-5]?)?|[3-9]\d?|0)(?:\.(?:1\d?\d?|2(?:[0-4]\d?|[6789]|5[0-5]?)?|[3-9]\d?|0)){3}

That said, I haven't tried this myself, so who knows...
I know that problem is already solved, but... it's definetely too long regexp. I love the power of regular expressions, so here is my shorter version (w/o non-capturing parentheses, for increased readability), where each octet range from 0 to 255:

^0*(2(5[0-5]|[0-4]\d)|1?\d{1,2})(\.0*(2(5[0-5]|[0-4]\d)|1?\d{1,2})){3}$

QRegExpValidator of course doesn't need ^ and $ assertions.