Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-36506

QHostAddress::setAddress() does not parse the address correct

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.2.0
    • Network
    • None
    • windows,linux

    Description

      If following strings are given to QHostAddress::setAddress()it instead of printing ip value:
      QHostAddress( "" ) QHostAddress( "" ) QHostAddress( "" ) QHostAddress( "127.0.0.1" )
      It prints:
      QHostAddress( "0.0.0.1" ) QHostAddress( "1.0.0.2" ) QHostAddress( "1.2.0.3" ) QHostAddress( "127.0.0.1" )

      QHostAddress host1,host2,host3,host4;
          host1.setAddress("1");
          host2.setAddress("1.2");
          host3.setAddress("1.2.3");
          host4.setAddress("127.0.0.1");
      
          QList<QHostAddress> list;
          list<<host1<<host2<<host3<<host4;
      
          QHostInfo info;
          info.setAddresses(list);
      
          qDebug()<<info.addresses().at(0)<<info.addresses().at(1)<<info.addresses().at(2)<<info.addresses().at(3);
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richmoore Richard Moore (qtnetwork)
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes