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

QNetworkSession

To start a network interface or to tell the system to keep an interface connected for as long as you need it, you have to start a session:

QNetworkConfigurationManager manager;
QNetworkConfiguration cfg = manager.defaultConfiguration();
QNetworkSession *session = new QNetworkSession(cfg, this);
session->open(); 

A session is based on a configuration. When there is more than one session and you are not sure which one to use, use QNetworkConfigurationManager::defaultConfiguration(). It returns the system's default configuration. Based on this, you can create an instance of QNetworkSession. The first argument, the configuration, is required. The second is optional but is recommended since it sets a parent, and we do not have ...

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