title: Getting MAC ID in Qt
body: <p>I am using the following code to get the MAC ID in Qt.</p>
  
  <p>main.cpp</p>
  
  <pre><code>#include &lt;QtCore/QCoreApplication&gt;
  #include "QtNetwork/QNetworkInterface"
  #include "QString"
  
  QString getMacAddress()
  {
      foreach(QNetworkInterface interface, QNetworkInterface::allInterfaces())
      {
          // Return only the first non-loopback MAC Address
          if (!(interface.flags() &amp; QNetworkInterface::IsLoopBack))
              return interface.hardwareAddress();
          QString text = interface.hardwareAddress();
          qDebug() &lt;&lt; text;
      }
      return QString();
  }
  
  int main(int argc, char *argv[])
  {
      getMacAddress();
      QCoreApplication a(argc, argv);
      return a.exec();
  }
  </code></pre>
  
  <p>I am getting nothing in Console? Guide me thanks...</p>