<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Hardware address on Mac Os X]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">the following code works well on windows and linux and I get an hardware address but on mac os X (Qt5.6.0) I get an empty string :</p>
<pre><code>foreach(QNetworkInterface netInterface, QNetworkInterface::allInterfaces())
    {
        // Return only the first non-loopback MAC Address
        if (!(netInterface.flags() &amp; QNetworkInterface::IsLoopBack))
            return netInterface.hardwareAddress();
    }
    return QString();
</code></pre>
<p dir="auto">is there any other solution on mac os ?</p>
]]></description><link>https://forum.qt.io/topic/72164/hardware-address-on-mac-os-x</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 13:45:23 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/72164.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Oct 2016 06:57:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 21:40:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Can you re-test that on a more recent version of Qt ? With my current build of 5.7 it's working correctly.</p>
<p dir="auto">Try 5.6.1-1 at least or the 5.6.2 latest test package.</p>
]]></description><link>https://forum.qt.io/post/353363</link><guid isPermaLink="true">https://forum.qt.io/post/353363</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 11 Oct 2016 21:40:15 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 14:04:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a>, yes it might be bug.But I have done a function QString interfacetoMac(char * ) based on the freebsd code that returns the mac adress and I call interfacetoMac on "en0" (if the result is empty on "en1","en2") and I had the Mac address (hardware address) on the <a href="http://mac.So" target="_blank" rel="noopener noreferrer nofollow ugc">mac.So</a> my problem is <a href="http://solved.it" target="_blank" rel="noopener noreferrer nofollow ugc">solved.it</a> seems that Qt don't see en0 on the mac....</p>
]]></description><link>https://forum.qt.io/post/353258</link><guid isPermaLink="true">https://forum.qt.io/post/353258</guid><dc:creator><![CDATA[stephane78]]></dc:creator><pubDate>Tue, 11 Oct 2016 14:04:48 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 10:23:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> it is mac os 10.10.4 and Qt5.6.0</p>
]]></description><link>https://forum.qt.io/post/353185</link><guid isPermaLink="true">https://forum.qt.io/post/353185</guid><dc:creator><![CDATA[stephane78]]></dc:creator><pubDate>Tue, 11 Oct 2016 10:23:59 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 10:15:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stephane78">@<bdi>stephane78</bdi></a><br />
Oh, you should say Qt version and mac OS version btw. It might be bug or regression.</p>
]]></description><link>https://forum.qt.io/post/353183</link><guid isPermaLink="true">https://forum.qt.io/post/353183</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 11 Oct 2016 10:15:23 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 10:13:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a>, Hi, ifconfig detects en0 but  Qt doesn't detect it....so thanks I will try the code for freebsd above, with interfaces en0, en1 and en2.</p>
]]></description><link>https://forum.qt.io/post/353182</link><guid isPermaLink="true">https://forum.qt.io/post/353182</guid><dc:creator><![CDATA[stephane78]]></dc:creator><pubDate>Tue, 11 Oct 2016 10:13:20 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 10:01:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stephane78">@<bdi>stephane78</bdi></a><br />
Just to be 100% sure, you did go and look in "hardware" on the mac that it does in fact have an address?</p>
<p dir="auto">lo0 = loopback<br />
gif0 = Software Network Interface<br />
stf0 = 6to4 tunnel interface<br />
en0 = Ethernet 0<br />
fw0 = Firewire<br />
en1 = Ethernet 1<br />
vmnet8 = Virtual Interface<br />
vmnet1 = Virtual Interface<br />
<a href="http://superuser.com/questions/267660/can-someone-please-explain-ifconfig-output-in-mac-os-x" target="_blank" rel="noopener noreferrer nofollow ugc">http://superuser.com/questions/267660/can-someone-please-explain-ifconfig-output-in-mac-os-x</a></p>
<p dir="auto">I do wonder why you dont have a en0 ?</p>
<p dir="auto">Happy coding :) i wish you luck.</p>
]]></description><link>https://forum.qt.io/post/353181</link><guid isPermaLink="true">https://forum.qt.io/post/353181</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 11 Oct 2016 10:01:47 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 09:55:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a>,Hi to add to the above things,I have two interfaces "lo0" and "gif0" if I use qDebug and <a href="http://netInterface.name" target="_blank" rel="noopener noreferrer nofollow ugc">netInterface.name</a>();.So now I will try the code that I mentioned above to get the mac address.</p>
]]></description><link>https://forum.qt.io/post/353179</link><guid isPermaLink="true">https://forum.qt.io/post/353179</guid><dc:creator><![CDATA[stephane78]]></dc:creator><pubDate>Tue, 11 Oct 2016 09:55:34 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 09:16:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a>, Hi I have found that :<a href="https://lists.freebsd.org/pipermail/freebsd-hackers/2004-June/007415.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://lists.freebsd.org/pipermail/freebsd-hackers/2004-June/007415.html</a> from that :<a href="http://stackoverflow.com/questions/10593736/mac-address-from-interface-on-os-x-c" target="_blank" rel="noopener noreferrer nofollow ugc">http://stackoverflow.com/questions/10593736/mac-address-from-interface-on-os-x-c</a>, so I can perhaps try this low level thing on mac os to get the mac address.I come here back again to tell you if it works....</p>
]]></description><link>https://forum.qt.io/post/353161</link><guid isPermaLink="true">https://forum.qt.io/post/353161</guid><dc:creator><![CDATA[stephane78]]></dc:creator><pubDate>Tue, 11 Oct 2016 09:16:25 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 09:02:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stephane78">@<bdi>stephane78</bdi></a><br />
Ok. should have a MAC for the lan. At least on linux/windows.</p>
<p dir="auto">So lets wait and see if an actual macintosh users know if its a bug or<br />
simply works differently for this platform :)</p>
]]></description><link>https://forum.qt.io/post/353159</link><guid isPermaLink="true">https://forum.qt.io/post/353159</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 11 Oct 2016 09:02:04 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 08:55:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a> , Hi the wifi is not active and the mac is on lan with ethernet active (it is a macbook pro).</p>
]]></description><link>https://forum.qt.io/post/353157</link><guid isPermaLink="true">https://forum.qt.io/post/353157</guid><dc:creator><![CDATA[stephane78]]></dc:creator><pubDate>Tue, 11 Oct 2016 08:55:03 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 08:44:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/stephane78">@<bdi>stephane78</bdi></a><br />
Hi<br />
It might be related to the actual hardware.</p>
<p dir="auto">Do you have this macintosh on lan or only wifi?</p>
<p dir="auto">Is it possible by other means to list the hw adr?</p>
<p dir="auto">Some interfaces do not have. ( at least on windows. Im not on mac OS<br />
so not sure if same applies)</p>
<p dir="auto">Maybe try to list the various data from QNetworkConfiguration?</p>
]]></description><link>https://forum.qt.io/post/353154</link><guid isPermaLink="true">https://forum.qt.io/post/353154</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 11 Oct 2016 08:44:16 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 08:38:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mrjj">@<bdi>mrjj</bdi></a>,Hi, I have called qDebug &lt;&lt;"mac address :"&lt;&lt;netInterface.hardwareAddress(); in the loop foreach and I get 4 empty hardware <a href="http://Addresses.so" target="_blank" rel="noopener noreferrer nofollow ugc">Addresses.so</a> QNetworkInterface::allInterfaces() is not empty but each hardwareAddress() is empty</p>
]]></description><link>https://forum.qt.io/post/353149</link><guid isPermaLink="true">https://forum.qt.io/post/353149</guid><dc:creator><![CDATA[stephane78]]></dc:creator><pubDate>Tue, 11 Oct 2016 08:38:33 GMT</pubDate></item><item><title><![CDATA[Reply to Hardware address on Mac Os X on Tue, 11 Oct 2016 07:35:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi<br />
You should insert some qDebug to see what is going on.<br />
If you get empty string, it means</p>
<p dir="auto">QNetworkInterface::allInterfaces() is empty list</p>
<p dir="auto">Or  !(netInterface.flags() &amp; QNetworkInterface::IsLoopBack)</p>
<p dir="auto">is never true</p>
<p dir="auto">So does it detect any interfaces ?</p>
]]></description><link>https://forum.qt.io/post/353139</link><guid isPermaLink="true">https://forum.qt.io/post/353139</guid><dc:creator><![CDATA[mrjj]]></dc:creator><pubDate>Tue, 11 Oct 2016 07:35:35 GMT</pubDate></item></channel></rss>