Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-updates > by-pkgid > 768f7d9f703884aa2562bf0a651086df > files > 1796

qtbase5-doc-5.9.4-1.1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qhostaddress.cpp -->
  <title>QHostAddress Class | Qt Network 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtnetwork-index.html">Qt Network</a></td><td ><a href="qtnetwork-module.html">C++ Classes</a></td><td >QHostAddress</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QHostAddress Class</h1>
<!-- $$$QHostAddress-brief -->
<p>The <a href="qhostaddress.html">QHostAddress</a> class provides an IP address. <a href="#details">More...</a></p>
<!-- @@@QHostAddress -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QHostAddress&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += network</td></tr></table></div><ul>
<li><a href="qhostaddress-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#ConversionModeFlag-enum">ConversionMode</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#ConversionModeFlag-enum">ConversionModeFlag</a></b> { StrictConversion, ConvertV4MappedToIPv4, ConvertV4CompatToIPv4, ConvertLocalHost, ConvertUnspecifiedAddress, TolerantConversion }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#SpecialAddress-enum">SpecialAddress</a></b> { Null, LocalHost, LocalHostIPv6, Broadcast, ..., Any }</td></tr>
</table></div>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#QHostAddress">QHostAddress</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#QHostAddress-1">QHostAddress</a></b>(quint32 <i>ip4Addr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#QHostAddress-2">QHostAddress</a></b>(quint8 *<i>ip6Addr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#QHostAddress-3">QHostAddress</a></b>(const quint8 *<i>ip6Addr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#QHostAddress-4">QHostAddress</a></b>(const Q_IPV6ADDR &amp;<i>ip6Addr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#QHostAddress-5">QHostAddress</a></b>(const sockaddr *<i>sockaddr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#QHostAddress-6">QHostAddress</a></b>(const QString &amp;<i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#QHostAddress-7">QHostAddress</a></b>(const QHostAddress &amp;<i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#QHostAddress-8">QHostAddress</a></b>(SpecialAddress <i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#dtor.QHostAddress">~QHostAddress</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#clear">clear</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#isEqual">isEqual</a></b>(const QHostAddress &amp;<i>other</i>, ConversionMode <i>mode</i> = TolerantConversion) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#isInSubnet">isInSubnet</a></b>(const QHostAddress &amp;<i>subnet</i>, int <i>netmask</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#isInSubnet-1">isInSubnet</a></b>(const QPair&lt;QHostAddress, int&gt; &amp;<i>subnet</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#isLoopback">isLoopback</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#isMulticast">isMulticast</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#isNull">isNull</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAbstractSocket::NetworkLayerProtocol </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#protocol">protocol</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#scopeId">scopeId</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#setAddress">setAddress</a></b>(quint32 <i>ip4Addr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#setAddress-1">setAddress</a></b>(quint8 *<i>ip6Addr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#setAddress-2">setAddress</a></b>(const quint8 *<i>ip6Addr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#setAddress-3">setAddress</a></b>(const Q_IPV6ADDR &amp;<i>ip6Addr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#setAddress-4">setAddress</a></b>(const sockaddr *<i>sockaddr</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#setAddress-5">setAddress</a></b>(const QString &amp;<i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#setAddress-6">setAddress</a></b>(SpecialAddress <i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#setScopeId">setScopeId</a></b>(const QString &amp;<i>id</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#swap">swap</a></b>(QHostAddress &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> quint32 </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#toIPv4Address">toIPv4Address</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> quint32 </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#toIPv4Address-1">toIPv4Address</a></b>(bool *<i>ok</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Q_IPV6ADDR </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#toIPv6Address">toIPv6Address</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#toString">toString</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-not-eq">operator!=</a></b>(const QHostAddress &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-not-eq-1">operator!=</a></b>(SpecialAddress <i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress &amp;</td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-eq">operator=</a></b>(QHostAddress &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress &amp;</td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-eq-1">operator=</a></b>(const QHostAddress &amp;<i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress &amp;</td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-eq-2">operator=</a></b>(const QString &amp;<i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress &amp;</td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-eq-3">operator=</a></b>(SpecialAddress <i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-eq-eq">operator==</a></b>(const QHostAddress &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-eq-eq-1">operator==</a></b>(SpecialAddress <i>other</i>) const</td></tr>
</table></div>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QPair&lt;QHostAddress, int&gt; </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#parseSubnet">parseSubnet</a></b>(const QString &amp;<i>subnet</i>)</td></tr>
</table></div>
<a name="related-non-members"></a>
<h2 id="related-non-members">Related Non-Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> uint </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#qHash">qHash</a></b>(const QHostAddress &amp;<i>key</i>, uint <i>seed</i> = 0)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-not-eq-2">operator!=</a></b>(QHostAddress::SpecialAddress <i>lhs</i>, const QHostAddress &amp;<i>rhs</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-lt-lt">operator&lt;&lt;</a></b>(QDataStream &amp;<i>out</i>, const QHostAddress &amp;<i>address</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-eq-eq-2">operator==</a></b>(QHostAddress::SpecialAddress <i>lhs</i>, const QHostAddress &amp;<i>rhs</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp;</td><td class="memItemRight bottomAlign"><b><a href="qhostaddress.html#operator-gt-gt">operator&gt;&gt;</a></b>(QDataStream &amp;<i>in</i>, QHostAddress &amp;<i>address</i>)</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QHostAddress-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qhostaddress.html">QHostAddress</a> class provides an IP address.</p>
<p>This class holds an IPv4 or IPv6 address in a platform- and protocol-independent manner.</p>
<p><a href="qhostaddress.html">QHostAddress</a> is normally used with the <a href="qtcpsocket.html">QTcpSocket</a>, <a href="qtcpserver.html">QTcpServer</a>, and <a href="qudpsocket.html">QUdpSocket</a> to connect to a host or to set up a server.</p>
<p>A host address is set with <a href="qhostaddress.html#setAddress">setAddress</a>(), and retrieved with <a href="qhostaddress.html#toIPv4Address">toIPv4Address</a>(), <a href="qhostaddress.html#toIPv6Address">toIPv6Address</a>(), or <a href="qhostaddress.html#toString">toString</a>(). You can check the type with <a href="qhostaddress.html#protocol">protocol</a>().</p>
<p><b>Note: </b>Please note that <a href="qhostaddress.html">QHostAddress</a> does not do DNS lookups. <a href="qhostinfo.html">QHostInfo</a> is needed for that.</p><p>The class also supports common predefined addresses: <a href="qhostaddress.html#SpecialAddress-enum">Null</a>, <a href="qhostaddress.html#SpecialAddress-enum">LocalHost</a>, <a href="qhostaddress.html#SpecialAddress-enum">LocalHostIPv6</a>, <a href="qhostaddress.html#SpecialAddress-enum">Broadcast</a>, and <a href="qhostaddress.html#SpecialAddress-enum">Any</a>.</p>
</div>
<p><b>See also </b><a href="qhostinfo.html">QHostInfo</a>, <a href="qtcpsocket.html">QTcpSocket</a>, <a href="qtcpserver.html">QTcpServer</a>, and <a href="qudpsocket.html">QUdpSocket</a>.</p>
<!-- @@@QHostAddress -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ConversionModeFlag$$$ConvertV4MappedToIPv4$$$ConvertV4CompatToIPv4$$$ConvertUnspecifiedAddress$$$ConvertLocalHost$$$TolerantConversion$$$StrictConversion -->
<h3 class="flags" id="ConversionModeFlag-enum"><a name="ConversionModeFlag-enum"></a>enum QHostAddress::<span class="name">ConversionModeFlag</span><br/>flags QHostAddress::<span class="name">ConversionMode</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QHostAddress::StrictConversion</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">Don't convert IPv6 addresses to IPv4 when comparing two <a href="qhostaddress.html">QHostAddress</a> objects of different protocols, so they will always be considered different.</td></tr>
<tr><td class="topAlign"><code>QHostAddress::ConvertV4MappedToIPv4</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">Convert IPv4-mapped IPv6 addresses (RFC 4291 sect. 2.5&#x2e;5&#x2e;2) when comparing. Therefore <a href="qhostaddress.html">QHostAddress</a>(&quot;::ffff:192.168.1&#x2e;1&quot;) will compare equal to <a href="qhostaddress.html">QHostAddress</a>(&quot;192.168.1&#x2e;1&quot;).</td></tr>
<tr><td class="topAlign"><code>QHostAddress::ConvertV4CompatToIPv4</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">Convert IPv4-compatible IPv6 addresses (RFC 4291 sect. 2.5&#x2e;5&#x2e;1) when comparing. Therefore <a href="qhostaddress.html">QHostAddress</a>(&quot;::192.168.1&#x2e;1&quot;) will compare equal to <a href="qhostaddress.html">QHostAddress</a>(&quot;192.168.1&#x2e;1&quot;).</td></tr>
<tr><td class="topAlign"><code>QHostAddress::ConvertLocalHost</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign">Convert the IPv6 loopback addresses to its IPv4 equivalent when comparing. Therefore e.g&#x2e; <a href="qhostaddress.html">QHostAddress</a>(&quot;::1&quot;) will compare equal to <a href="qhostaddress.html">QHostAddress</a>(&quot;127.0&#x2e;0&#x2e;1&quot;).</td></tr>
<tr><td class="topAlign"><code>QHostAddress::ConvertUnspecifiedAddress</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">All unspecified addresses will compare equal, namely <a href="qhostaddress.html#SpecialAddress-enum">AnyIPv4</a>, <a href="qhostaddress.html#SpecialAddress-enum">AnyIPv6</a> and Any.</td></tr>
<tr><td class="topAlign"><code>QHostAddress::TolerantConversion</code></td><td class="topAlign tblval"><code>0xff</code></td><td class="topAlign">Sets all three preceding flags.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 5.8.</p>
<p>The ConversionMode type is a typedef for <a href="../qtcore/qflags.html">QFlags</a>&lt;ConversionModeFlag&gt;. It stores an OR combination of ConversionModeFlag values.</p>
<p><b>See also </b><a href="qhostaddress.html#isEqual">isEqual</a>().</p>
<!-- @@@ConversionModeFlag -->
<!-- $$$SpecialAddress$$$Null$$$Broadcast$$$LocalHost$$$LocalHostIPv6$$$Any$$$AnyIPv6$$$AnyIPv4 -->
<h3 class="fn" id="SpecialAddress-enum"><a name="SpecialAddress-enum"></a>enum QHostAddress::<span class="name">SpecialAddress</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QHostAddress::Null</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The null address object. Equivalent to <a href="qhostaddress.html#QHostAddress">QHostAddress</a>(). See also <a href="qhostaddress.html#isNull">QHostAddress::isNull</a>().</td></tr>
<tr><td class="topAlign"><code>QHostAddress::LocalHost</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The IPv4 localhost address. Equivalent to <a href="qhostaddress.html">QHostAddress</a>(&quot;127.0&#x2e;0&#x2e;1&quot;).</td></tr>
<tr><td class="topAlign"><code>QHostAddress::LocalHostIPv6</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The IPv6 localhost address. Equivalent to <a href="qhostaddress.html">QHostAddress</a>(&quot;::1&quot;).</td></tr>
<tr><td class="topAlign"><code>QHostAddress::Broadcast</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The IPv4 broadcast address. Equivalent to <a href="qhostaddress.html">QHostAddress</a>(&quot;255.255.255.255&quot;).</td></tr>
<tr><td class="topAlign"><code>QHostAddress::AnyIPv4</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">The IPv4 any-address. Equivalent to <a href="qhostaddress.html">QHostAddress</a>(&quot;0.0&#x2e;0&#x2e;0&quot;). A socket bound with this address will listen only on IPv4 interaces.</td></tr>
<tr><td class="topAlign"><code>QHostAddress::AnyIPv6</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">The IPv6 any-address. Equivalent to <a href="qhostaddress.html">QHostAddress</a>(&quot;::&quot;). A socket bound with this address will listen only on IPv6 interaces.</td></tr>
<tr><td class="topAlign"><code>QHostAddress::Any</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">The dual stack any-address. A socket bound with this address will listen on both IPv4 and IPv6 interfaces.</td></tr>
</table></div>
<!-- @@@SpecialAddress -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QHostAddress[overload1]$$$QHostAddress -->
<h3 class="fn" id="QHostAddress"><a name="QHostAddress"></a>QHostAddress::<span class="name">QHostAddress</span>()</h3>
<p>Constructs a null host address object, i.e&#x2e; an address which is not valid for any host or interface.</p>
<p><b>See also </b><a href="qhostaddress.html#clear">clear</a>().</p>
<!-- @@@QHostAddress -->
<!-- $$$QHostAddress$$$QHostAddressquint32 -->
<h3 class="fn" id="QHostAddress-1"><a name="QHostAddress-1"></a>QHostAddress::<span class="name">QHostAddress</span>(<span class="type"><a href="../qtcore/qtglobal.html#quint32-typedef">quint32</a></span> <i>ip4Addr</i>)</h3>
<p>Constructs a host address object with the IPv4 address <i>ip4Addr</i>.</p>
<!-- @@@QHostAddress -->
<!-- $$$QHostAddress$$$QHostAddressquint8* -->
<h3 class="fn" id="QHostAddress-2"><a name="QHostAddress-2"></a>QHostAddress::<span class="name">QHostAddress</span>(<span class="type"><a href="../qtcore/qtglobal.html#quint8-typedef">quint8</a></span> *<i>ip6Addr</i>)</h3>
<p>Constructs a host address object with the IPv6 address <i>ip6Addr</i>.</p>
<p><i>ip6Addr</i> must be a 16-byte array in network byte order (big endian).</p>
<!-- @@@QHostAddress -->
<!-- $$$QHostAddress$$$QHostAddressconstquint8* -->
<h3 class="fn" id="QHostAddress-3"><a name="QHostAddress-3"></a>QHostAddress::<span class="name">QHostAddress</span>(const <span class="type"><a href="../qtcore/qtglobal.html#quint8-typedef">quint8</a></span> *<i>ip6Addr</i>)</h3>
<p>Constructs a host address object with the IPv6 address <i>ip6Addr</i>.</p>
<p><i>ip6Addr</i> must be a 16-byte array in network byte order (big endian).</p>
<p>This function was introduced in  Qt 5.5.</p>
<!-- @@@QHostAddress -->
<!-- $$$QHostAddress$$$QHostAddressconstQ_IPV6ADDR& -->
<h3 class="fn" id="QHostAddress-4"><a name="QHostAddress-4"></a>QHostAddress::<span class="name">QHostAddress</span>(const <span class="type">Q_IPV6ADDR</span> &amp;<i>ip6Addr</i>)</h3>
<p>Constructs a host address object with the IPv6 address <i>ip6Addr</i>.</p>
<!-- @@@QHostAddress -->
<!-- $$$QHostAddress$$$QHostAddressconstsockaddr* -->
<h3 class="fn" id="QHostAddress-5"><a name="QHostAddress-5"></a>QHostAddress::<span class="name">QHostAddress</span>(const <span class="type">sockaddr</span> *<i>sockaddr</i>)</h3>
<p>Constructs an IPv4 or IPv6 address using the address specified by the native structure <i>sockaddr</i>.</p>
<p><b>See also </b><a href="qhostaddress.html#setAddress">setAddress</a>().</p>
<!-- @@@QHostAddress -->
<!-- $$$QHostAddress$$$QHostAddressconstQString& -->
<h3 class="fn" id="QHostAddress-6"><a name="QHostAddress-6"></a>QHostAddress::<span class="name">QHostAddress</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>address</i>)</h3>
<p>Constructs an IPv4 or IPv6 address based on the string <i>address</i> (e.g&#x2e;, &quot;127.0&#x2e;0&#x2e;1&quot;).</p>
<p><b>See also </b><a href="qhostaddress.html#setAddress">setAddress</a>().</p>
<!-- @@@QHostAddress -->
<!-- $$$QHostAddress$$$QHostAddressconstQHostAddress& -->
<h3 class="fn" id="QHostAddress-7"><a name="QHostAddress-7"></a>QHostAddress::<span class="name">QHostAddress</span>(const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>address</i>)</h3>
<p>Constructs a copy of the given <i>address</i>.</p>
<!-- @@@QHostAddress -->
<!-- $$$QHostAddress$$$QHostAddressSpecialAddress -->
<h3 class="fn" id="QHostAddress-8"><a name="QHostAddress-8"></a>QHostAddress::<span class="name">QHostAddress</span>(<span class="type"><a href="qhostaddress.html#SpecialAddress-enum">SpecialAddress</a></span> <i>address</i>)</h3>
<p>Constructs a <a href="qhostaddress.html">QHostAddress</a> object for <i>address</i>.</p>
<!-- @@@QHostAddress -->
<!-- $$$~QHostAddress[overload1]$$$~QHostAddress -->
<h3 class="fn" id="dtor.QHostAddress"><a name="dtor.QHostAddress"></a>QHostAddress::<span class="name">~QHostAddress</span>()</h3>
<p>Destroys the host address object.</p>
<!-- @@@~QHostAddress -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn" id="clear"><a name="clear"></a><span class="type">void</span> QHostAddress::<span class="name">clear</span>()</h3>
<p>Sets the host address to null.</p>
<p><b>See also </b><a href="qhostaddress.html#SpecialAddress-enum">QHostAddress::Null</a>.</p>
<!-- @@@clear -->
<!-- $$$isEqual[overload1]$$$isEqualconstQHostAddress&ConversionMode -->
<h3 class="fn" id="isEqual"><a name="isEqual"></a><span class="type">bool</span> QHostAddress::<span class="name">isEqual</span>(const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>other</i>, <span class="type"><a href="qhostaddress.html#ConversionModeFlag-enum">ConversionMode</a></span> <i>mode</i> = TolerantConversion) const</h3>
<p>Returns <code>true</code> if this host address is the same as the <i>other</i> address given; otherwise returns <code>false</code>.</p>
<p>The parameter <i>mode</i> controls which conversions are preformed between addresses of differing protocols. If no <i>mode</i> is given, <code>TolerantConversion</code> is performed by default.</p>
<p>This function was introduced in  Qt 5.8.</p>
<p><b>See also </b><a href="qhostaddress.html#ConversionModeFlag-enum">ConversionMode</a> and <a href="qhostaddress.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@isEqual -->
<!-- $$$isInSubnet[overload1]$$$isInSubnetconstQHostAddress&int -->
<h3 class="fn" id="isInSubnet"><a name="isInSubnet"></a><span class="type">bool</span> QHostAddress::<span class="name">isInSubnet</span>(const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>subnet</i>, <span class="type">int</span> <i>netmask</i>) const</h3>
<p>Returns <code>true</code> if this IP is in the subnet described by the network prefix <i>subnet</i> and netmask <i>netmask</i>.</p>
<p>An IP is considered to belong to a subnet if it is contained between the lowest and the highest address in that subnet. In the case of IP version 4, the lowest address is the network address, while the highest address is the broadcast address.</p>
<p>The <i>subnet</i> argument does not have to be the actual network address (the lowest address in the subnet). It can be any valid IP belonging to that subnet. In particular, if it is equal to the IP address held by this object, this function will always return true (provided the netmask is a valid value).</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qhostaddress.html#parseSubnet">parseSubnet</a>().</p>
<!-- @@@isInSubnet -->
<!-- $$$isInSubnet$$$isInSubnetconstQPair<QHostAddress,int>& -->
<h3 class="fn" id="isInSubnet-1"><a name="isInSubnet-1"></a><span class="type">bool</span> QHostAddress::<span class="name">isInSubnet</span>(const <span class="type"><a href="../qtcore/qpair.html">QPair</a></span>&lt;<span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span>, <span class="type">int</span>&gt; &amp;<i>subnet</i>) const</h3>
<p>This is an overloaded function.</p>
<p>Returns <code>true</code> if this IP is in the subnet described by <i>subnet</i>. The <a href="qhostaddress.html">QHostAddress</a> member of <i>subnet</i> contains the network prefix and the int (second) member contains the netmask (prefix length).</p>
<p>This function was introduced in  Qt 4.5.</p>
<!-- @@@isInSubnet -->
<!-- $$$isLoopback[overload1]$$$isLoopback -->
<h3 class="fn" id="isLoopback"><a name="isLoopback"></a><span class="type">bool</span> QHostAddress::<span class="name">isLoopback</span>() const</h3>
<p>returns <code>true</code> if the address is the IPv6 loopback address, or any of the IPv4 loopback addresses.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@isLoopback -->
<!-- $$$isMulticast[overload1]$$$isMulticast -->
<h3 class="fn" id="isMulticast"><a name="isMulticast"></a><span class="type">bool</span> QHostAddress::<span class="name">isMulticast</span>() const</h3>
<p>Returns <code>true</code> if the address is an IPv4 or IPv6 multicast address, <code>false</code> otherwise.</p>
<p>This function was introduced in  Qt 5.6.</p>
<!-- @@@isMulticast -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn" id="isNull"><a name="isNull"></a><span class="type">bool</span> QHostAddress::<span class="name">isNull</span>() const</h3>
<p>Returns <code>true</code> if this host address is not valid for any host or interface.</p>
<p>The default constructor creates a null address.</p>
<p><b>See also </b><a href="qhostaddress.html#SpecialAddress-enum">QHostAddress::Null</a>.</p>
<!-- @@@isNull -->
<!-- $$$parseSubnet[overload1]$$$parseSubnetconstQString& -->
<h3 class="fn" id="parseSubnet"><a name="parseSubnet"></a><code>[static] </code><span class="type"><a href="../qtcore/qpair.html">QPair</a></span>&lt;<span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span>, <span class="type">int</span>&gt; QHostAddress::<span class="name">parseSubnet</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>subnet</i>)</h3>
<p>Parses the IP and subnet information contained in <i>subnet</i> and returns the network prefix for that network and its prefix length.</p>
<p>The IP address and the netmask must be separated by a slash (/).</p>
<p>This function supports arguments in the form:</p>
<ul>
<li>123.123.123.123/n where n is any value between 0 and 32</li>
<li>123.123.123.123/255.255.255.255</li>
<li>&lt;ipv6-address&gt;/n where n is any value between 0 and 128</li>
</ul>
<p>For IP version 4, this function accepts as well missing trailing components (i.e&#x2e;, less than 4 octets, like &quot;192.168.1&quot;), followed or not by a dot. If the netmask is also missing in that case, it is set to the number of octets actually passed (in the example above, it would be 24, for 3 octets).</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qhostaddress.html#isInSubnet">isInSubnet</a>().</p>
<!-- @@@parseSubnet -->
<!-- $$$protocol[overload1]$$$protocol -->
<h3 class="fn" id="protocol"><a name="protocol"></a><span class="type"><a href="qabstractsocket.html#NetworkLayerProtocol-enum">QAbstractSocket::NetworkLayerProtocol</a></span> QHostAddress::<span class="name">protocol</span>() const</h3>
<p>Returns the network layer protocol of the host address.</p>
<!-- @@@protocol -->
<!-- $$$scopeId[overload1]$$$scopeId -->
<h3 class="fn" id="scopeId"><a name="scopeId"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QHostAddress::<span class="name">scopeId</span>() const</h3>
<p>Returns the scope ID of an IPv6 address. For IPv4 addresses, or if the address does not contain a scope ID, an empty <a href="../qtcore/qstring.html">QString</a> is returned.</p>
<p>The IPv6 scope ID specifies the scope of <i>reachability</i> for non-global IPv6 addresses, limiting the area in which the address can be used. All IPv6 addresses are associated with such a reachability scope. The scope ID is used to disambiguate addresses that are not guaranteed to be globally unique.</p>
<p>IPv6 specifies the following four levels of reachability:</p>
<ul>
<li>Node-local: Addresses that are only used for communicating with services on the same interface (e.g&#x2e;, the loopback interface &quot;::1&quot;).</li>
<li>Link-local: Addresses that are local to the network interface (<i>link</i>). There is always one link-local address for each IPv6 interface on your host. Link-local addresses (&quot;fe80..&#x2e;&quot;) are generated from the MAC address of the local network adaptor, and are not guaranteed to be unique.</li>
<li>Global: For globally routable addresses, such as public servers on the Internet.</li>
</ul>
<p>When using a link-local or site-local address for IPv6 connections, you must specify the scope ID. The scope ID for a link-local address is usually the same as the interface name (e.g&#x2e;, &quot;eth0&quot;, &quot;en1&quot;) or number (e.g&#x2e;, &quot;1&quot;, &quot;2&quot;).</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qhostaddress.html#setScopeId">setScopeId</a>(), <a href="qnetworkinterface.html">QNetworkInterface</a>, and <a href="qnetworkinterface.html#interfaceFromName">QNetworkInterface::interfaceFromName</a>.</p>
<!-- @@@scopeId -->
<!-- $$$setAddress[overload1]$$$setAddressquint32 -->
<h3 class="fn" id="setAddress"><a name="setAddress"></a><span class="type">void</span> QHostAddress::<span class="name">setAddress</span>(<span class="type"><a href="../qtcore/qtglobal.html#quint32-typedef">quint32</a></span> <i>ip4Addr</i>)</h3>
<p>Set the IPv4 address specified by <i>ip4Addr</i>.</p>
<!-- @@@setAddress -->
<!-- $$$setAddress$$$setAddressquint8* -->
<h3 class="fn" id="setAddress-1"><a name="setAddress-1"></a><span class="type">void</span> QHostAddress::<span class="name">setAddress</span>(<span class="type"><a href="../qtcore/qtglobal.html#quint8-typedef">quint8</a></span> *<i>ip6Addr</i>)</h3>
<p>This is an overloaded function.</p>
<p>Set the IPv6 address specified by <i>ip6Addr</i>.</p>
<p><i>ip6Addr</i> must be an array of 16 bytes in network byte order (high-order byte first).</p>
<!-- @@@setAddress -->
<!-- $$$setAddress$$$setAddressconstquint8* -->
<h3 class="fn" id="setAddress-2"><a name="setAddress-2"></a><span class="type">void</span> QHostAddress::<span class="name">setAddress</span>(const <span class="type"><a href="../qtcore/qtglobal.html#quint8-typedef">quint8</a></span> *<i>ip6Addr</i>)</h3>
<p>This is an overloaded function.</p>
<p>Set the IPv6 address specified by <i>ip6Addr</i>.</p>
<p><i>ip6Addr</i> must be an array of 16 bytes in network byte order (high-order byte first).</p>
<p>This function was introduced in  Qt 5.5.</p>
<!-- @@@setAddress -->
<!-- $$$setAddress$$$setAddressconstQ_IPV6ADDR& -->
<h3 class="fn" id="setAddress-3"><a name="setAddress-3"></a><span class="type">void</span> QHostAddress::<span class="name">setAddress</span>(const <span class="type">Q_IPV6ADDR</span> &amp;<i>ip6Addr</i>)</h3>
<p>This is an overloaded function.</p>
<p>Set the IPv6 address specified by <i>ip6Addr</i>.</p>
<!-- @@@setAddress -->
<!-- $$$setAddress$$$setAddressconstsockaddr* -->
<h3 class="fn" id="setAddress-4"><a name="setAddress-4"></a><span class="type">void</span> QHostAddress::<span class="name">setAddress</span>(const <span class="type">sockaddr</span> *<i>sockaddr</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the IPv4 or IPv6 address specified by the native structure <i>sockaddr</i>. Returns <code>true</code> and sets the address if the address was successfully parsed; otherwise returns <code>false</code>.</p>
<!-- @@@setAddress -->
<!-- $$$setAddress$$$setAddressconstQString& -->
<h3 class="fn" id="setAddress-5"><a name="setAddress-5"></a><span class="type">bool</span> QHostAddress::<span class="name">setAddress</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>address</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the IPv4 or IPv6 address specified by the string representation specified by <i>address</i> (e.g&#x2e; &quot;127.0&#x2e;0&#x2e;1&quot;). Returns <code>true</code> and sets the address if the address was successfully parsed; otherwise returns <code>false</code>.</p>
<!-- @@@setAddress -->
<!-- $$$setAddress$$$setAddressSpecialAddress -->
<h3 class="fn" id="setAddress-6"><a name="setAddress-6"></a><span class="type">void</span> QHostAddress::<span class="name">setAddress</span>(<span class="type"><a href="qhostaddress.html#SpecialAddress-enum">SpecialAddress</a></span> <i>address</i>)</h3>
<p>This is an overloaded function.</p>
<p>Sets the special address specified by <i>address</i>.</p>
<p>This function was introduced in  Qt 5.8.</p>
<!-- @@@setAddress -->
<!-- $$$setScopeId[overload1]$$$setScopeIdconstQString& -->
<h3 class="fn" id="setScopeId"><a name="setScopeId"></a><span class="type">void</span> QHostAddress::<span class="name">setScopeId</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>id</i>)</h3>
<p>Sets the IPv6 scope ID of the address to <i>id</i>. If the address protocol is not IPv6, this function does nothing. The scope ID may be set as an interface name (such as &quot;eth0&quot; or &quot;en1&quot;) or as an integer representing the interface index. If <i>id</i> is an interface name, <a href="qtnetwork-module.html">QtNetwork</a> will convert to an interface index using <a href="qnetworkinterface.html#interfaceIndexFromName">QNetworkInterface::interfaceIndexFromName</a>() before calling the operating system networking functions.</p>
<p>This function was introduced in  Qt 4.1.</p>
<p><b>See also </b><a href="qhostaddress.html#scopeId">scopeId</a>(), <a href="qnetworkinterface.html">QNetworkInterface</a>, and <a href="qnetworkinterface.html#interfaceFromName">QNetworkInterface::interfaceFromName</a>.</p>
<!-- @@@setScopeId -->
<!-- $$$swap[overload1]$$$swapQHostAddress& -->
<h3 class="fn" id="swap"><a name="swap"></a><span class="type">void</span> QHostAddress::<span class="name">swap</span>(<span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>other</i>)</h3>
<p>Swaps this host address with <i>other</i>. This operation is very fast and never fails.</p>
<p>This function was introduced in  Qt 5.6.</p>
<!-- @@@swap -->
<!-- $$$toIPv4Address[overload1]$$$toIPv4Address -->
<h3 class="fn" id="toIPv4Address"><a name="toIPv4Address"></a><span class="type"><a href="../qtcore/qtglobal.html#quint32-typedef">quint32</a></span> QHostAddress::<span class="name">toIPv4Address</span>() const</h3>
<p>Returns the IPv4 address as a number.</p>
<p>For example, if the address is 127.0&#x2e;0&#x2e;1, the returned value is 2130706433 (i.e&#x2e; 0x7f000001).</p>
<p>This value is valid if the <a href="qhostaddress.html#protocol">protocol</a>() is <a href="qabstractsocket.html#NetworkLayerProtocol-enum">IPv4Protocol</a>, or if the protocol is <a href="qabstractsocket.html#NetworkLayerProtocol-enum">IPv6Protocol</a>, and the IPv6 address is an IPv4 mapped address. (RFC4291)</p>
<p><b>See also </b><a href="qhostaddress.html#toString">toString</a>().</p>
<!-- @@@toIPv4Address -->
<!-- $$$toIPv4Address$$$toIPv4Addressbool* -->
<h3 class="fn" id="toIPv4Address-1"><a name="toIPv4Address-1"></a><span class="type"><a href="../qtcore/qtglobal.html#quint32-typedef">quint32</a></span> QHostAddress::<span class="name">toIPv4Address</span>(<span class="type">bool</span> *<i>ok</i>) const</h3>
<p>Returns the IPv4 address as a number.</p>
<p>For example, if the address is 127.0&#x2e;0&#x2e;1, the returned value is 2130706433 (i.e&#x2e; 0x7f000001).</p>
<p>This value is valid if the <a href="qhostaddress.html#protocol">protocol</a>() is <a href="qabstractsocket.html#NetworkLayerProtocol-enum">IPv4Protocol</a>, or if the protocol is <a href="qabstractsocket.html#NetworkLayerProtocol-enum">IPv6Protocol</a>, and the IPv6 address is an IPv4 mapped address. (RFC4291). In those cases, <i>ok</i> will be set to true. Otherwise, it will be set to false.</p>
<p><b>See also </b><a href="qhostaddress.html#toString">toString</a>().</p>
<!-- @@@toIPv4Address -->
<!-- $$$toIPv6Address[overload1]$$$toIPv6Address -->
<h3 class="fn" id="toIPv6Address"><a name="toIPv6Address"></a><span class="type">Q_IPV6ADDR</span> QHostAddress::<span class="name">toIPv6Address</span>() const</h3>
<p>Returns the IPv6 address as a Q_IPV6ADDR structure. The structure consists of 16 unsigned characters.</p>
<pre class="cpp">

  Q_IPV6ADDR addr <span class="operator">=</span> hostAddr<span class="operator">.</span>toIPv6Address();
  <span class="comment">// addr contains 16 unsigned characters</span>

  <span class="keyword">for</span> (<span class="type">int</span> i <span class="operator">=</span> <span class="number">0</span>; i <span class="operator">&lt;</span> <span class="number">16</span>; <span class="operator">+</span><span class="operator">+</span>i) {
      <span class="comment">// process addr[i]</span>
  }

</pre>
<p>This value is valid if the <a href="qhostaddress.html#protocol">protocol</a>() is <a href="qabstractsocket.html#NetworkLayerProtocol-enum">IPv6Protocol</a>. If the protocol is <a href="qabstractsocket.html#NetworkLayerProtocol-enum">IPv4Protocol</a>, then the address is returned an an IPv4 mapped IPv6 address. (RFC4291)</p>
<p><b>See also </b><a href="qhostaddress.html#toString">toString</a>().</p>
<!-- @@@toIPv6Address -->
<!-- $$$toString[overload1]$$$toString -->
<h3 class="fn" id="toString"><a name="toString"></a><span class="type"><a href="../qtcore/qstring.html">QString</a></span> QHostAddress::<span class="name">toString</span>() const</h3>
<p>Returns the address as a string.</p>
<p>For example, if the address is the IPv4 address 127.0&#x2e;0&#x2e;1, the returned string is &quot;127.0&#x2e;0&#x2e;1&quot;. For IPv6 the string format will follow the RFC5952 recommendation. For <a href="qhostaddress.html#SpecialAddress-enum">QHostAddress::Any</a>, its IPv4 address will be returned (&quot;0.0&#x2e;0&#x2e;0&quot;)</p>
<p><b>See also </b><a href="qhostaddress.html#toIPv4Address">toIPv4Address</a>().</p>
<!-- @@@toString -->
<!-- $$$operator!=[overload1]$$$operator!=constQHostAddress& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QHostAddress::<span class="name">operator!=</span>(const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this host address is not the same as the <i>other</i> address given; otherwise returns <code>false</code>.</p>
<p>This function was introduced in  Qt 4.2.</p>
<!-- @@@operator!= -->
<!-- $$$operator!=$$$operator!=SpecialAddress -->
<h3 class="fn" id="operator-not-eq-1"><a name="operator-not-eq-1"></a><span class="type">bool</span> QHostAddress::<span class="name">operator!=</span>(<span class="type"><a href="qhostaddress.html#SpecialAddress-enum">SpecialAddress</a></span> <i>other</i>) const</h3>
<p>Returns <code>true</code> if this host address is not the same as the <i>other</i> address given; otherwise returns <code>false</code>.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=QHostAddress&& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;QHostAddress::<span class="name">operator=</span>(<span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-assignment operator.</p><!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQHostAddress& -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;QHostAddress::<span class="name">operator=</span>(const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>address</i>)</h3>
<p>Assigns another host <i>address</i> to this object, and returns a reference to this object.</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQString& -->
<h3 class="fn" id="operator-eq-2"><a name="operator-eq-2"></a><span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;QHostAddress::<span class="name">operator=</span>(const <span class="type"><a href="../qtcore/qstring.html">QString</a></span> &amp;<i>address</i>)</h3>
<p>Assigns the host address <i>address</i> to this object, and returns a reference to this object.</p>
<p><b>See also </b><a href="qhostaddress.html#setAddress">setAddress</a>().</p>
<!-- @@@operator= -->
<!-- $$$operator=$$$operator=SpecialAddress -->
<h3 class="fn" id="operator-eq-3"><a name="operator-eq-3"></a><span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;QHostAddress::<span class="name">operator=</span>(<span class="type"><a href="qhostaddress.html#SpecialAddress-enum">SpecialAddress</a></span> <i>address</i>)</h3>
<p>Assigns the special address <i>address</i> to this object, and returns a reference to this object.</p>
<p>This function was introduced in  Qt 5.8.</p>
<p><b>See also </b><a href="qhostaddress.html#setAddress">setAddress</a>().</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQHostAddress& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QHostAddress::<span class="name">operator==</span>(const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this host address is the same as the <i>other</i> address given; otherwise returns <code>false</code>. This operator just calls <a href="qhostaddress.html#isEqual">isEqual</a>(other, <a href="qhostaddress.html#ConversionModeFlag-enum">StrictConversion</a>).</p>
<p><b>See also </b><a href="qhostaddress.html#isEqual">isEqual</a>().</p>
<!-- @@@operator== -->
<!-- $$$operator==$$$operator==SpecialAddress -->
<h3 class="fn" id="operator-eq-eq-1"><a name="operator-eq-eq-1"></a><span class="type">bool</span> QHostAddress::<span class="name">operator==</span>(<span class="type"><a href="qhostaddress.html#SpecialAddress-enum">SpecialAddress</a></span> <i>other</i>) const</h3>
<p>Returns <code>true</code> if this host address is the same as the <i>other</i> address given; otherwise returns <code>false</code>.</p>
<!-- @@@operator== -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qHash[overload1]$$$qHashconstQHostAddress&uint -->
<h3 class="fn" id="qHash"><a name="qHash"></a><span class="type"><a href="../qtcore/qtglobal.html#uint-typedef">uint</a></span> <span class="name">qHash</span>(const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>key</i>, <span class="type"><a href="../qtcore/qtglobal.html#uint-typedef">uint</a></span> <i>seed</i> = 0)</h3>
<p>Returns a hash of the host address <i>key</i>, using <i>seed</i> to seed the calculation.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@qHash -->
<!-- $$$operator!=$$$operator!=QHostAddress::SpecialAddressconstQHostAddress& -->
<h3 class="fn" id="operator-not-eq-2"><a name="operator-not-eq-2"></a><span class="type">bool</span> <span class="name">operator!=</span>(<span class="type"><a href="qhostaddress.html#SpecialAddress-enum">QHostAddress::SpecialAddress</a></span> <i>lhs</i>, const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>rhs</i>)</h3>
<p>Returns <code>false</code> if special address <i>lhs</i> is the same as host address <i>rhs</i>; otherwise returns <code>true</code>.</p>
<p>This function was introduced in  Qt 5.9.</p>
<p><b>See also </b><a href="../qmake/qmake-test-function-reference.html#isequal">isEqual</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator<<[overload1]$$$operator<<QDataStream&constQHostAddress& -->
<h3 class="fn" id="operator-lt-lt"><a name="operator-lt-lt"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&lt;&lt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>out</i>, const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>address</i>)</h3>
<p>Writes host address <i>address</i> to the stream <i>out</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator==$$$operator==QHostAddress::SpecialAddressconstQHostAddress& -->
<h3 class="fn" id="operator-eq-eq-2"><a name="operator-eq-eq-2"></a><span class="type">bool</span> <span class="name">operator==</span>(<span class="type"><a href="qhostaddress.html#SpecialAddress-enum">QHostAddress::SpecialAddress</a></span> <i>lhs</i>, const <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>rhs</i>)</h3>
<p>Returns <code>true</code> if special address <i>lhs</i> is the same as host address <i>rhs</i>; otherwise returns <code>false</code>.</p>
<p><b>See also </b><a href="../qmake/qmake-test-function-reference.html#isequal">isEqual</a>().</p>
<!-- @@@operator== -->
<!-- $$$operator>>[overload1]$$$operator>>QDataStream&QHostAddress& -->
<h3 class="fn" id="operator-gt-gt"><a name="operator-gt-gt"></a><span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<span class="name">operator&gt;&gt;</span>(<span class="type"><a href="../qtcore/qdatastream.html">QDataStream</a></span> &amp;<i>in</i>, <span class="type"><a href="qhostaddress.html#QHostAddress">QHostAddress</a></span> &amp;<i>address</i>)</h3>
<p>Reads a host address into <i>address</i> from the stream <i>in</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="../qtcore/datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>