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
    NOK

    Result from Qt 5.4.1 build:
    OK
    OK

    Is this a bug? Or I am doing something wrong?


  • Moderators

    @rth See QTBUG-36506 for more info.



  • @p3c0 Thanks.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.