I want a line edit which accepts an ip address. If I give input mask as:
ui->lineEdit->setInputMask(\"000.000.000.000\");
It is accep
In accordance to Arun Kumar K S's answer:
If myIP.setAddress()
was successfull, you can write the ip back to the line edit as a formatted string:
ui->lineEdit->setText(myIP->toString());
Consequently, you don't neccessarily need to set a mask (nor a validator or regex).
Note setAddress() writes/overwrites your myIP also if it fails to read the ip. Thus, calling toString() in this case results in an empty string.