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 ...

Get Game Programming using Qt 5 Beginner's Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.