I'm trying to get a list of all the devices with a MAC address...and found the following on these forums.
|
PHP Source code
|
1
2
3
4
|
QList<QNetworkInterface> list = QNetworkInterface::allInterfaces();
foreach (QNetworkInterface i, list) {
qDebug() << i;
}
|
The problem is this code makes a list but the list has duplicate entries. So I tried to convert the QList to a QSet assuming this would result in a set of unique items by doing..
|
PHP Source code
|
1
|
QSet<QNetworkInterfaces> set = list.toSet();
|
But when I do this I get compile errors..
"no matching function for call to qHash(const QNetworkInterface&)"
..and..
"no match for 'operator==' in key() = ((QHashNode<QNetworkInterface, QHashDummyValue>*)this)->QHashNode<QNetworkInterface, QHashDummyValue>::key
I'm sure it's something I'm doing wrong, but I don't see it...