Try this code so show the hardware addresses of each interface:
QString getMacAddress()
{
QString text;
foreach(QNetworkInterface interface, QNetworkInterface::allInterfaces())
{
text += "Interface:"+interface.hardwareAddress()+"\n";
}
return text;
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
printf( "%s\n", getMacAddress().toAscii().constData() );
exit(1);
return a.exec();
}