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

Mismatch between implementation and documentation on QHostAddress::isIPv4Adress()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 4.7.0
    • 4.5.3, 4.6.0, 4.6.1, 4.6.2, 4.6.3, 4.7.0
    • Documentation
    • None
    • 10039e4b5bb80e5a9705126e7c62c588039acde6

      Up to 4.7, the documentation on QHostAddress says:

      in "Detailed Description":

      A host address is set with setAddress(), checked for its type using isIPv4Address() or isIPv6Address(), and retrieved with toIPv4Address(), toIPv6Address(), or toString().

      and on QHostAddress::toIPv4Address() (same for toIPv6Address)

      Returns the IPv4 address as a number.
      For example, if the address is 127.0.0.1, the returned value is 2130706433 (i.e. 0x7f000001).
      This value is only valid if isIp4Addr() returns true.

      -------
      So there are two different methods "isIp4Addr()" and "isIPv4Address()" but both are only available if built with Qt3 compatibility.
      Either the convenient methods should be brought back or the documentation should refer to "protocol() == QAbstractSocket::IPv4Protocol" or something.

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

            dm Geir Vattekar
            seezer Sebastian Goth
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes