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. QML Ask user to connect to the internet if not connected?
Forum Updated to NodeBB v4.3 + New Features

QML Ask user to connect to the internet if not connected?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 2.9k 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.
  • R Offline
    R Offline
    rash.m2k
    wrote on 21 Jan 2012, 11:55 last edited by
    #1

    I've got an app which connects to the internet to download stuff, but if there's no internet connection it just sits there not doing anything.

    How can I check for internet connection and then ask to user to connect if they are not connected?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 21 Jan 2012, 13:19 last edited by
      #2

      Check "QNetworkAccessManager::networkAccessible()":http://developer.qt.nokia.com/doc/qt-4.8/qnetworkaccessmanager.html#networkAccessible-prop

      (Z(:^

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rash.m2k
        wrote on 21 Jan 2012, 13:45 last edited by
        #3

        I was hoping there was a way to do it without any C++, this app that I am working on is purley QML so far and if possible I'd like to keep it that way.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 21 Jan 2012, 14:11 last edited by
          #4

          There seems to be one other possible path, but I have never used it, so I can't help much. Take a look at "QDeclarativeEngine::networkAccessManager()":http://developer.qt.nokia.com/doc/qt-4.8/qdeclarativeengine.html#networkAccessManager but it still does require C++, as it would seem.

          Or, you can use web kit or JS to access network. Or try to instantiate a QML component by URL, and display a message if that fails. But most probably, C++ will give you the most control over what is happening and when.

          (Z(:^

          1 Reply Last reply
          0

          3/4

          21 Jan 2012, 13:45

          • Login

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