In documentation says:
void QHostAddress::clear()
Sets the host address to 0.0.0.0.
but in real code:
QHostAddress addrFoo, addrBar;
addrFoo.clear();
addrBar.setAddress("0.0.0.0");
if (addrFoo == addrBar) {
qDebug() << "Foo == Bar";
} else {
qDebug() << "Foo != Bar";
}
Will be output “Foo != Bar”.
Because “clear()” method sets the host address to 0.0.0.0 or :: and set protocol to QAbstractSocket::UnknownNetworkLayerProtocol
In documentation says nothing about protocol.
↧