O'Reilly logo

Game Programming Using Qt by Lorenz Haas, Witold Wysota

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

Controlling the connectivity state

As a matter of fact, you can only use QNetworkAccessManager if you have an active connection to the Internet. Since you cannot theoretically know the connectivity state, you have to check this at the runtime of the application. With the help of the Bearer API, you can check whether the computer, mobile device, or tablet is online and you can even start a new connection—if the operating system supports it.

The Bearer API mainly consists of four classes. QNetworkConfigurationManager is the base and starting point. It holds all network configurations available on the system. Furthermore, it provides information about the network capabilities, for example, whether you can start and stop interfaces. The network configurations ...

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