O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required