title: How to get local IP address of a computer using QT
body: <p>I am trying to get the local ip address (IPV4) of a computer in QT.
  I found the following code:</p>
  
  <pre><code>QNetworkInterface *inter = new QNetworkInterface();
  QList&lt;QHostAddress&gt; list;
  list=inter-&gt;allAddresses();
  QString str;
  
  for (int i = 0; i &lt; list.size(); ++i) {
       str = list.at(i).toString();
  }
  </code></pre>
  
  <p>Going through for loop I can see there are a number of values (ip's) in the <code>list</code>, one of them is the actual local ip address that I get by typing <code>ipconfig</code> in a command window.</p>
  
  <p>My question is how to distinguish the ip address from all the ip's that are in <code>list</code>?</p>