QHostAdress behaves differently with Qt 5.4.1
-
Hello.
Following simple application gives different results when compiled against Qt 4.8.5 and Qt 5.4.1:
#include <QCoreApplication> #include <QHostAddress> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QString ip("1"); //QString ip("x"); QHostAddress adr; if (adr.setAddress(ip)) qDebug() << "OK"; else qDebug() << "NOK"; if (adr.isNull()) qDebug() << "NOK"; else qDebug() << "OK"; //return a.exec(); }
Result from Qt 4.8.5 build:
NOK
NOKResult from Qt 5.4.1 build:
OK
OKIs this a bug? Or I am doing something wrong?
-
Hello.
Following simple application gives different results when compiled against Qt 4.8.5 and Qt 5.4.1:
#include <QCoreApplication> #include <QHostAddress> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QString ip("1"); //QString ip("x"); QHostAddress adr; if (adr.setAddress(ip)) qDebug() << "OK"; else qDebug() << "NOK"; if (adr.isNull()) qDebug() << "NOK"; else qDebug() << "OK"; //return a.exec(); }
Result from Qt 4.8.5 build:
NOK
NOKResult from Qt 5.4.1 build:
OK
OKIs this a bug? Or I am doing something wrong?
@_rth_ See QTBUG-36506 for more info.
-
@_rth_ See QTBUG-36506 for more info.