You are not logged in.

Search results

Search results 1-2 of 2.

Thursday, October 26th 2017, 6:26am

Author: ssahu

IPv4 address validation for bounds

I am using a text field to get ip address as user input and to validate I use QHostAddress addr; if(addr.setAddress(myQString){ if(QAbstractSocket::IPv4Protocol==addr.protocol()){ qDebug("Valid IPv4 address.");} } but for 123.999.999.999 it says is a valid address. It just checks for the format. How can I check for bounds.

Thursday, October 12th 2017, 6:42am

Author: ssahu

IPv4 address validation for bounds

I am using a text field to get ip address as user input and to validate I use QHostAddress addr; if(addr.setAddress(myQString){ if(QAbstractSocket::IPv4Protocol==addr.protocol()){ qDebug("Valid IPv4 address.");} } but for 123.999.999.999 it says is a valid address. It just checks for the format. How can I check for bounds.