Game Programming using Qt 5 Beginner's Guide - Second Edition
by Pavel Strakhov, Witold Wysota, Lorenz Haas
QNetworkInterface
To get the interface that is used by a session, call QNetworkSession::interface(). It will return the QNetworkInterface object, which describes the interface. With hardwareAddress(), you get the low-level hardware address of the interface that is normally the MAC address. The name of the interface can be obtained by name(), which is a string such as "eth0" or "wlan0". A list of IP addresses as well as their netmasks and broadcast addresses registered with the interface is returned by addressEntries(). Furthermore, information about whether the interface is a loopback or whether it supports multicasting can be queried with flags(). The returned bitmask is a combination of these values: IsUp, IsRunning, CanBroadcast, IsLoopBack ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access