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. Help Connecting to a wifi
QtWS25 Last Chance

Help Connecting to a wifi

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.0k 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.
  • G Offline
    G Offline
    Guilherme Tell
    wrote on last edited by
    #1

    Hello.
    I have this code that does a list of Network Connections(ppp0, em1, wlan0) of my machine
    @
    void MainWindow::ListConnections(){
    QList<QNetworkConfiguration> confList = manager->allConfigurations();
    int i=0;
    for(i;i<confList.count();i++){
    ui->listWidget->addItem(new QListWidgetItem(confList.at(i).name()));
    }

    }
    

    @

    i want to use one of those returned connections(wlan0), to connect, how can i do that?
    Thanks...

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      you won't get around using your target OS's api to do that...
      There is no Qt to do it if your asking for such a solution.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Are you thinking of something like "that":http://qt-project.org/doc/qt-4.8/qnetworkaccessmanager.html#setConfiguration ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Guilherme Tell
          wrote on last edited by
          #4

          yes but setting the configuration is
          @
          QNetworkConfigurationManager manager;
          networkAccessManager->setConfiguration(manager.defaultConfiguration());@
          i need one to be choosen from the list...

          Thanks...

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            That's just the example to use the default configuration.

            So you mean something like:

            @QList<QNetworkConfiguration> confList = manager->allConfigurations();
            foreach(QNetworkConfiguration configuration, confList){
            if (configuration.name() == "wlan0") {
            manager->setConfiguration(configuration);
            break;
            }
            }
            @

            ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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