Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QNetworkConfiguration in ligtmap example
Forum Update on Monday, May 27th 2025

QNetworkConfiguration in ligtmap example

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt5mapconfiguration
3 Posts 3 Posters 491 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deleted286
    wrote on 22 Jan 2021, 07:29 last edited by
    #1

    Hi everyone. Im working on lightmap example in Qt, I didnt undersand the logic that i quote in the below. Can anybody explain me?

    void MapZoom::sessionOpened()
    {
    // Save the used configuration
    QNetworkConfiguration config = networkSession->configuration();
    QString id;
    if (config.type() == QNetworkConfiguration::UserChoice) {
    id = networkSession->sessionProperty(
    QLatin1String("UserChoiceConfiguration")).toString();
    } else {
    id = config.identifier();
    }

    QSettings settings(QSettings::UserScope, QLatin1String("QtProject"));
    settings.beginGroup(QLatin1String("QtNetwork"));
    settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
    settings.endGroup();
    

    }

    J 1 Reply Last reply 22 Jan 2021, 07:34
    0
    • D deleted286
      22 Jan 2021, 07:29

      Hi everyone. Im working on lightmap example in Qt, I didnt undersand the logic that i quote in the below. Can anybody explain me?

      void MapZoom::sessionOpened()
      {
      // Save the used configuration
      QNetworkConfiguration config = networkSession->configuration();
      QString id;
      if (config.type() == QNetworkConfiguration::UserChoice) {
      id = networkSession->sessionProperty(
      QLatin1String("UserChoiceConfiguration")).toString();
      } else {
      id = config.identifier();
      }

      QSettings settings(QSettings::UserScope, QLatin1String("QtProject"));
      settings.beginGroup(QLatin1String("QtNetwork"));
      settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id);
      settings.endGroup();
      

      }

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 22 Jan 2021, 07:34 last edited by
      #2

      @suslucoder What exactly don't you understand? QSettings part? Did you read its documentation?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 22 Jan 2021, 07:36 last edited by
        #3

        And please use the code-tags to make your code readable!

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        0

        2/3

        22 Jan 2021, 07:34

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved