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 Updated to NodeBB v4.3 + New Features

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 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();
    

    }

    jsulmJ 1 Reply Last reply
    0
    • D deleted286

      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();
      

      }

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 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

        • Login

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