QHostAddress, documentation clear() != setAddress("0.0.0.0")
-
In documentation says:
bq.
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. -
welcome to devnet
Thanks for sharing this information on inprecision of the documentation.
However, this site is not monitored by Qt developers for bugs and problems. You need to report the issue on "JIRA.":https://bugreports.qt-project.org/secure/Dashboard.jspa
-
Done. "QTBUG-31280":https://bugreports.qt-project.org/browse/QTBUG-31280