Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 2074

qtbase5-doc-5.12.6-2.mga7.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" />
<!-- qnetworkinterface.cpp -->
  <title>QNetworkAddressEntry Class | Qt Network 5.12.6</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.12</td><td ><a href="qtnetwork-index.html">Qt Network</a></td><td ><a href="qtnetwork-module.html">C++ Classes</a></td><td >QNetworkAddressEntry</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtnetwork-index.html">Qt 5.12.6 Reference Documentation</a></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="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QNetworkAddressEntry Class</h1>
<!-- $$$QNetworkAddressEntry-brief -->
<p>The <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> class stores one IP address supported by a network interface, along with its associated netmask and broadcast address. <a href="#details">More...</a></p>
<!-- @@@QNetworkAddressEntry -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QNetworkAddressEntry&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += network</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.2</td></tr></table></div><ul>
<li><a href="qnetworkaddressentry-members.html">List of all members, including inherited members</a></li>
</ul>
<p><b>Note:</b> All functions in this class are reentrant.</p>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#DnsEligibilityStatus-enum">DnsEligibilityStatus</a></b> { DnsEligibilityUnknown, DnsEligible, DnsIneligible }</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="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#QNetworkAddressEntry-1">QNetworkAddressEntry</a></b>(const QNetworkAddressEntry &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#dtor.QNetworkAddressEntry">~QNetworkAddressEntry</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#broadcast">broadcast</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#clearAddressLifetime">clearAddressLifetime</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkAddressEntry::DnsEligibilityStatus </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#dnsEligibility">dnsEligibility</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#ip">ip</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#isPermanent">isPermanent</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#isTemporary">isTemporary</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QHostAddress </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#netmask">netmask</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDeadlineTimer </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#preferredLifetime">preferredLifetime</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#prefixLength">prefixLength</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setAddressLifetime">setAddressLifetime</a></b>(QDeadlineTimer <i>preferred</i>, QDeadlineTimer <i>validity</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setBroadcast">setBroadcast</a></b>(const QHostAddress &amp;<i>newBroadcast</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setDnsEligibility">setDnsEligibility</a></b>(QNetworkAddressEntry::DnsEligibilityStatus <i>status</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setIp">setIp</a></b>(const QHostAddress &amp;<i>newIp</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setNetmask">setNetmask</a></b>(const QHostAddress &amp;<i>newNetmask</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#setPrefixLength">setPrefixLength</a></b>(int <i>length</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#swap">swap</a></b>(QNetworkAddressEntry &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDeadlineTimer </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#validityLifetime">validityLifetime</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#operator-not-eq">operator!=</a></b>(const QNetworkAddressEntry &amp;<i>other</i>) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkAddressEntry &amp;</td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#operator-eq">operator=</a></b>(QNetworkAddressEntry &amp;&amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkAddressEntry &amp;</td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#operator-eq-1">operator=</a></b>(const QNetworkAddressEntry &amp;<i>other</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qnetworkaddressentry.html#operator-eq-eq">operator==</a></b>(const QNetworkAddressEntry &amp;<i>other</i>) const</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QNetworkAddressEntry-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> class stores one IP address supported by a network interface, along with its associated netmask and broadcast address.</p>
<p>Each network interface can contain zero or more IP addresses, which in turn can be associated with a netmask and/or a broadcast address (depending on support from the operating system).</p>
<p>This class represents one such group.</p>
</div>
<!-- @@@QNetworkAddressEntry -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$DnsEligibilityStatus$$$DnsEligibilityUnknown$$$DnsIneligible$$$DnsEligible -->
<h3 class="fn" id="DnsEligibilityStatus-enum"><a name="DnsEligibilityStatus-enum"></a>enum QNetworkAddressEntry::<span class="name">DnsEligibilityStatus</span></h3>
<p>This enum indicates whether a given host address is eligible to be published in the Domain Name System (DNS) or other similar name resolution mechanisms. In general, an address is suitable for publication if it is an address this machine will be reached at for an indeterminate amount of time, though it need not be permanent. For example, addresses obtained via DHCP are often eligible, but cryptographically-generated temporary IPv6 addresses are not.</p>
<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>QNetworkAddressEntry::DnsEligibilityUnknown</code></td><td class="topAlign tblval"><code>-1</code></td><td class="topAlign">Qt and the operating system could not determine whether this address should be published or not. The application may need to apply further heuristics if it cannot find any eligible addresses.</td></tr>
<tr><td class="topAlign"><code>QNetworkAddressEntry::DnsEligible</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">This address is eligible for publication in DNS.</td></tr>
<tr><td class="topAlign"><code>QNetworkAddressEntry::DnsIneligible</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">This address should not be published in DNS and should not be transmitted to other parties, except maybe as the source address of an outgoing packet.</td></tr>
</table></div>
<p>This enum was introduced or modified in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#dnsEligibility">dnsEligibility</a>() and <a href="qnetworkaddressentry.html#setDnsEligibility">setDnsEligibility</a>().</p>
<!-- @@@DnsEligibilityStatus -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QNetworkAddressEntry[overload1]$$$QNetworkAddressEntry -->
<h3 class="fn" id="QNetworkAddressEntry"><a name="QNetworkAddressEntry"></a>QNetworkAddressEntry::<span class="name">QNetworkAddressEntry</span>()</h3>
<p>Constructs an empty <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object.</p>
<!-- @@@QNetworkAddressEntry -->
<!-- $$$QNetworkAddressEntry$$$QNetworkAddressEntryconstQNetworkAddressEntry& -->
<h3 class="fn" id="QNetworkAddressEntry-1"><a name="QNetworkAddressEntry-1"></a>QNetworkAddressEntry::<span class="name">QNetworkAddressEntry</span>(const <span class="type"><a href="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></span> &amp;<i>other</i>)</h3>
<p>Constructs a <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object that is a copy of the object <i>other</i>.</p>
<!-- @@@QNetworkAddressEntry -->
<!-- $$$~QNetworkAddressEntry[overload1]$$$~QNetworkAddressEntry -->
<h3 class="fn" id="dtor.QNetworkAddressEntry"><a name="dtor.QNetworkAddressEntry"></a>QNetworkAddressEntry::<span class="name">~QNetworkAddressEntry</span>()</h3>
<p>Destroys this <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object.</p>
<!-- @@@~QNetworkAddressEntry -->
<!-- $$$broadcast[overload1]$$$broadcast -->
<h3 class="fn" id="broadcast"><a name="broadcast"></a><span class="type"><a href="qhostaddress.html">QHostAddress</a></span> QNetworkAddressEntry::<span class="name">broadcast</span>() const</h3>
<p>Returns the broadcast address associated with the IPv4 address and netmask. It can usually be derived from those two by setting to 1 the bits of the IP address where the netmask contains a 0. (In other words, by bitwise-OR'ing the IP address with the inverse of the netmask)</p>
<p>This member is always empty for IPv6 addresses, since the concept of broadcast has been abandoned in that system in favor of multicast. In particular, the group of hosts corresponding to all the nodes in the local network can be reached by the &quot;all-nodes&quot; special multicast group (address FF02::1).</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#setBroadcast">setBroadcast</a>().</p>
<!-- @@@broadcast -->
<!-- $$$clearAddressLifetime[overload1]$$$clearAddressLifetime -->
<h3 class="fn" id="clearAddressLifetime"><a name="clearAddressLifetime"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">clearAddressLifetime</span>()</h3>
<p>Resets both the preferred and valid lifetimes for this address. After this call, <a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>() will return <code>false</code>.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#preferredLifetime">preferredLifetime</a>(), <a href="qnetworkaddressentry.html#validityLifetime">validityLifetime</a>(), <a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>(), and <a href="qnetworkaddressentry.html#setAddressLifetime">setAddressLifetime</a>().</p>
<!-- @@@clearAddressLifetime -->
<!-- $$$dnsEligibility[overload1]$$$dnsEligibility -->
<h3 class="fn" id="dnsEligibility"><a name="dnsEligibility"></a><span class="type"><a href="qnetworkaddressentry.html#DnsEligibilityStatus-enum">QNetworkAddressEntry::DnsEligibilityStatus</a></span> QNetworkAddressEntry::<span class="name">dnsEligibility</span>() const</h3>
<p>Returns whether this address is eligible for publication in the Domain Name System (DNS) or similar name resolution mechanisms.</p>
<p>In general, an address is suitable for publication if it is an address this machine will be reached at for an indeterminate amount of time, though it need not be permanent. For example, addresses obtained via DHCP are often eligible, but cryptographically-generated temporary IPv6 addresses are not.</p>
<p>On some systems, <a href="qnetworkinterface.html">QNetworkInterface</a> will need to heuristically determine which addresses are eligible.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>(), <a href="qnetworkaddressentry.html#isPermanent">isPermanent</a>(), and <a href="qnetworkaddressentry.html#setDnsEligibility">setDnsEligibility</a>().</p>
<!-- @@@dnsEligibility -->
<!-- $$$ip[overload1]$$$ip -->
<h3 class="fn" id="ip"><a name="ip"></a><span class="type"><a href="qhostaddress.html">QHostAddress</a></span> QNetworkAddressEntry::<span class="name">ip</span>() const</h3>
<p>This function returns one IPv4 or IPv6 address found, that was found in a network interface.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#setIp">setIp</a>().</p>
<!-- @@@ip -->
<!-- $$$isLifetimeKnown[overload1]$$$isLifetimeKnown -->
<h3 class="fn" id="isLifetimeKnown"><a name="isLifetimeKnown"></a><span class="type">bool</span> QNetworkAddressEntry::<span class="name">isLifetimeKnown</span>() const</h3>
<p>Returns <code>true</code> if the address lifetime is known, <code>false</code> if not. If the lifetime is not known, both <a href="qnetworkaddressentry.html#preferredLifetime">preferredLifetime</a>() and <a href="qnetworkaddressentry.html#validityLifetime">validityLifetime</a>() will return <a href="../qtcore/qdeadlinetimer.html#ForeverConstant-enum">QDeadlineTimer::Forever</a>.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#preferredLifetime">preferredLifetime</a>(), <a href="qnetworkaddressentry.html#validityLifetime">validityLifetime</a>(), <a href="qnetworkaddressentry.html#setAddressLifetime">setAddressLifetime</a>(), and <a href="qnetworkaddressentry.html#clearAddressLifetime">clearAddressLifetime</a>().</p>
<!-- @@@isLifetimeKnown -->
<!-- $$$isPermanent[overload1]$$$isPermanent -->
<h3 class="fn" id="isPermanent"><a name="isPermanent"></a><span class="type">bool</span> QNetworkAddressEntry::<span class="name">isPermanent</span>() const</h3>
<p>Returns <code>true</code> if this address is permanent on this interface, <code>false</code> if it's temporary. A permenant address is one which has no expiration time and is often static (manually configured).</p>
<p>If this information could not be determined, this function returns <code>true</code>.</p>
<p><b>Note: </b>Depending on the operating system and the networking configuration tool, it is possible for a temporary address to be interpreted as permanent, if the tool did not inform the details correctly to the operating system.</p><p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>(), <a href="qnetworkaddressentry.html#validityLifetime">validityLifetime</a>(), and <a href="qnetworkaddressentry.html#isTemporary">isTemporary</a>().</p>
<!-- @@@isPermanent -->
<!-- $$$isTemporary[overload1]$$$isTemporary -->
<h3 class="fn" id="isTemporary"><a name="isTemporary"></a><span class="type">bool</span> QNetworkAddressEntry::<span class="name">isTemporary</span>() const</h3>
<p>Returns <code>true</code> if this address is temporary on this interface, <code>false</code> if it's permanent.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>(), <a href="qnetworkaddressentry.html#validityLifetime">validityLifetime</a>(), and <a href="qnetworkaddressentry.html#isPermanent">isPermanent</a>().</p>
<!-- @@@isTemporary -->
<!-- $$$netmask[overload1]$$$netmask -->
<h3 class="fn" id="netmask"><a name="netmask"></a><span class="type"><a href="qhostaddress.html">QHostAddress</a></span> QNetworkAddressEntry::<span class="name">netmask</span>() const</h3>
<p>Returns the netmask associated with the IP address. The netmask is expressed in the form of an IP address, such as 255.255.0&#x2e;0&#x2e;</p>
<p>For IPv6 addresses, the prefix length is converted to an address where the number of bits set to 1 is equal to the prefix length. For a prefix length of 64 bits (the most common value), the netmask will be expressed as a <a href="qhostaddress.html">QHostAddress</a> holding the address FFFF:FFFF:FFFF:FFFF::</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#setNetmask">setNetmask</a>() and <a href="qnetworkaddressentry.html#prefixLength">prefixLength</a>().</p>
<!-- @@@netmask -->
<!-- $$$preferredLifetime[overload1]$$$preferredLifetime -->
<h3 class="fn" id="preferredLifetime"><a name="preferredLifetime"></a><span class="type"><a href="../qtcore/qdeadlinetimer.html">QDeadlineTimer</a></span> QNetworkAddressEntry::<span class="name">preferredLifetime</span>() const</h3>
<p>Returns the deadline when this address becomes deprecated (no longer preferred), if known. If the address lifetime is not known (see <a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>()), this function always returns <a href="../qtcore/qdeadlinetimer.html#ForeverConstant-enum">QDeadlineTimer::Forever</a>.</p>
<p>While an address is preferred, it may be used by the operating system as the source address for new, outgoing packets. After it becomes deprecated, it will remain valid for incoming packets for a while longer until finally removed (see <a href="qnetworkaddressentry.html#validityLifetime">validityLifetime</a>()).</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#validityLifetime">validityLifetime</a>(), <a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>(), <a href="qnetworkaddressentry.html#setAddressLifetime">setAddressLifetime</a>(), and <a href="qnetworkaddressentry.html#clearAddressLifetime">clearAddressLifetime</a>().</p>
<!-- @@@preferredLifetime -->
<!-- $$$prefixLength[overload1]$$$prefixLength -->
<h3 class="fn" id="prefixLength"><a name="prefixLength"></a><span class="type">int</span> QNetworkAddressEntry::<span class="name">prefixLength</span>() const</h3>
<p>Returns the prefix length of this IP address. The prefix length matches the number of bits set to 1 in the netmask (see <a href="qnetworkaddressentry.html#netmask">netmask</a>()). For IPv4 addresses, the value is between 0 and 32. For IPv6 addresses, it's contained between 0 and 128 and is the preferred form of representing addresses.</p>
<p>This function returns -1 if the prefix length could not be determined (i.e&#x2e;, <a href="qnetworkaddressentry.html#netmask">netmask</a>() returns a null QHostAddress()).</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#setPrefixLength">setPrefixLength</a>() and <a href="qnetworkaddressentry.html#netmask">netmask</a>().</p>
<!-- @@@prefixLength -->
<!-- $$$setAddressLifetime[overload1]$$$setAddressLifetimeQDeadlineTimerQDeadlineTimer -->
<h3 class="fn" id="setAddressLifetime"><a name="setAddressLifetime"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setAddressLifetime</span>(<span class="type"><a href="../qtcore/qdeadlinetimer.html">QDeadlineTimer</a></span> <i>preferred</i>, <span class="type"><a href="../qtcore/qdeadlinetimer.html">QDeadlineTimer</a></span> <i>validity</i>)</h3>
<p>Sets both the preferred and valid lifetimes for this address to the <i>preferred</i> and <i>validity</i> deadlines, respectively. After this call, <a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>() will return <code>true</code>, even if both parameters are <a href="../qtcore/qdeadlinetimer.html#ForeverConstant-enum">QDeadlineTimer::Forever</a>.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#preferredLifetime">preferredLifetime</a>(), <a href="qnetworkaddressentry.html#validityLifetime">validityLifetime</a>(), <a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>(), and <a href="qnetworkaddressentry.html#clearAddressLifetime">clearAddressLifetime</a>().</p>
<!-- @@@setAddressLifetime -->
<!-- $$$setBroadcast[overload1]$$$setBroadcastconstQHostAddress& -->
<h3 class="fn" id="setBroadcast"><a name="setBroadcast"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setBroadcast</span>(const <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> &amp;<i>newBroadcast</i>)</h3>
<p>Sets the broadcast IP address of this <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object to <i>newBroadcast</i>.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#broadcast">broadcast</a>().</p>
<!-- @@@setBroadcast -->
<!-- $$$setDnsEligibility[overload1]$$$setDnsEligibilityQNetworkAddressEntry::DnsEligibilityStatus -->
<h3 class="fn" id="setDnsEligibility"><a name="setDnsEligibility"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setDnsEligibility</span>(<span class="type"><a href="qnetworkaddressentry.html#DnsEligibilityStatus-enum">QNetworkAddressEntry::DnsEligibilityStatus</a></span> <i>status</i>)</h3>
<p>Sets the DNS eligibility flag for this address to <i>status</i>.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#dnsEligibility">dnsEligibility</a>().</p>
<!-- @@@setDnsEligibility -->
<!-- $$$setIp[overload1]$$$setIpconstQHostAddress& -->
<h3 class="fn" id="setIp"><a name="setIp"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setIp</span>(const <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> &amp;<i>newIp</i>)</h3>
<p>Sets the IP address the <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object contains to <i>newIp</i>.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#ip">ip</a>().</p>
<!-- @@@setIp -->
<!-- $$$setNetmask[overload1]$$$setNetmaskconstQHostAddress& -->
<h3 class="fn" id="setNetmask"><a name="setNetmask"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setNetmask</span>(const <span class="type"><a href="qhostaddress.html">QHostAddress</a></span> &amp;<i>newNetmask</i>)</h3>
<p>Sets the netmask that this <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object contains to <i>newNetmask</i>. Setting the netmask also sets the prefix length to match the new netmask.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#netmask">netmask</a>() and <a href="qnetworkaddressentry.html#setPrefixLength">setPrefixLength</a>().</p>
<!-- @@@setNetmask -->
<!-- $$$setPrefixLength[overload1]$$$setPrefixLengthint -->
<h3 class="fn" id="setPrefixLength"><a name="setPrefixLength"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">setPrefixLength</span>(<span class="type">int</span> <i>length</i>)</h3>
<p>Sets the prefix length of this IP address to <i>length</i>. The value of <i>length</i> must be valid for this type of IP address: between 0 and 32 for IPv4 addresses, between 0 and 128 for IPv6 addresses. Setting to any invalid value is equivalent to setting to -1, which means &quot;no prefix length&quot;.</p>
<p>Setting the prefix length also sets the netmask (see <a href="qnetworkaddressentry.html#netmask">netmask</a>()).</p>
<p>This function was introduced in  Qt 4.5.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#prefixLength">prefixLength</a>() and <a href="qnetworkaddressentry.html#setNetmask">setNetmask</a>().</p>
<!-- @@@setPrefixLength -->
<!-- $$$swap[overload1]$$$swapQNetworkAddressEntry& -->
<h3 class="fn" id="swap"><a name="swap"></a><span class="type">void</span> QNetworkAddressEntry::<span class="name">swap</span>(<span class="type"><a href="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></span> &amp;<i>other</i>)</h3>
<p>Swaps this network address entry instance with <i>other</i>. This function is very fast and never fails.</p>
<p>This function was introduced in  Qt 5.0.</p>
<!-- @@@swap -->
<!-- $$$validityLifetime[overload1]$$$validityLifetime -->
<h3 class="fn" id="validityLifetime"><a name="validityLifetime"></a><span class="type"><a href="../qtcore/qdeadlinetimer.html">QDeadlineTimer</a></span> QNetworkAddressEntry::<span class="name">validityLifetime</span>() const</h3>
<p>Returns the deadline when this address becomes invalid and will be removed from the networking stack, if known. If the address lifetime is not known (see <a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>()), this function always returns <a href="../qtcore/qdeadlinetimer.html#ForeverConstant-enum">QDeadlineTimer::Forever</a>.</p>
<p>While an address is valid, it will be accepted by the operating system as a valid destination address for this machine. Whether it is used as a source address for new, outgoing packets is controlled by, among other rules, the preferred lifetime (see <a href="qnetworkaddressentry.html#preferredLifetime">preferredLifetime</a>()).</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qnetworkaddressentry.html#preferredLifetime">preferredLifetime</a>(), <a href="qnetworkaddressentry.html#isLifetimeKnown">isLifetimeKnown</a>(), <a href="qnetworkaddressentry.html#setAddressLifetime">setAddressLifetime</a>(), and <a href="qnetworkaddressentry.html#clearAddressLifetime">clearAddressLifetime</a>().</p>
<!-- @@@validityLifetime -->
<!-- $$$operator!=[overload1]$$$operator!=constQNetworkAddressEntry& -->
<h3 class="fn" id="operator-not-eq"><a name="operator-not-eq"></a><span class="type">bool</span> QNetworkAddressEntry::<span class="name">operator!=</span>(const <span class="type"><a href="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this network address entry is different from <i>other</i>.</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=QNetworkAddressEntry&& -->
<h3 class="fn" id="operator-eq"><a name="operator-eq"></a><span class="type"><a href="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></span> &amp;QNetworkAddressEntry::<span class="name">operator=</span>(<span class="type"><a href="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></span> &amp;&amp;<i>other</i>)</h3>
<p>Move-assignment operator.</p><!-- @@@operator= -->
<!-- $$$operator=$$$operator=constQNetworkAddressEntry& -->
<h3 class="fn" id="operator-eq-1"><a name="operator-eq-1"></a><span class="type"><a href="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></span> &amp;QNetworkAddressEntry::<span class="name">operator=</span>(const <span class="type"><a href="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></span> &amp;<i>other</i>)</h3>
<p>Makes a copy of the <a href="qnetworkaddressentry.html">QNetworkAddressEntry</a> object <i>other</i>.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQNetworkAddressEntry& -->
<h3 class="fn" id="operator-eq-eq"><a name="operator-eq-eq"></a><span class="type">bool</span> QNetworkAddressEntry::<span class="name">operator==</span>(const <span class="type"><a href="qnetworkaddressentry.html#QNetworkAddressEntry">QNetworkAddressEntry</a></span> &amp;<i>other</i>) const</h3>
<p>Returns <code>true</code> if this network address entry is the same as <i>other</i>.</p>
<!-- @@@operator== -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 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>