Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. With QNetworkConfiguration, Wifi network is not re-discovered after using XMLHttpRequest
Forum Updated to NodeBB v4.3 + New Features

With QNetworkConfiguration, Wifi network is not re-discovered after using XMLHttpRequest

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 2.4k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    scifi.guy
    wrote on last edited by
    #1

    I am trying to avoid network selection prompt in my Qt Quick application. In the code, I verify whether any saved wifi networks are in range before sending a data request from QML. The application should not initiate a data pull when no saved networks are available, thus avoiding the network selection prompt. For this I am using allConfigurations(QNetworkConfiguration::Discovered).

    This code works fine if used independently. However, calling this function after using a wifi network once with XMLHttpRequest and then disconnecting changes the status of that network to just "Defined" even though it is still in range. Here is a sample code to reproduce the problem on N900.

    Before running the code make sure that a wifi network is defined (saved) and is in range.

    connectionutility.h [1]
    main.cpp [2]
    main.qml [3]

    Scenario 1: Without using XMLHttpRequest

    Step 1: Comment the line queryData(); in main.qml
    Step 2: Disconnect from wifi network (if connected)
    Step 3: Run the application on device, wait for 20 sec
    Expected result: The wifi used previously is displayed in console. (This works)

    Scenario 2: Using XMLHttpRequest

    Step 1: Uncomment the line queryData(); in main.qml
    Step 2: Disconnect from wifi network (if connected)
    Step 3: Run the application on device, connect to a wifi network (if prompted)
    Step 4: After the message "Now disconnect from wifi for testing" is displayed in console, disconnect from Wifi. Wait for 20 sec
    Expected result: The wifi used previously is displayed in console. (This doesn't work).

    Can anyone suggest a fix or a workaround for what I am trying to achieve?

    [1] - http://pastebin.com/fjRr4cyv
    [2] - http://pastebin.com/NJxuP7rB
    [3] - http://pastebin.com/3QQh1ce9

    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