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. No network connection
Forum Update on Monday, May 27th 2025

No network connection

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 3.4k 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.
  • _ Offline
    _ Offline
    _Arne
    wrote on last edited by
    #1

    Hi,

    I'm developing an application which needs a connection to the internet.
    To make a request, I use in javascript XMLHttpRequest.
    Everything goes fine most of the time, but sometimes I can't make a connection.
    I didn't manage to recognize a pattern when it can connect and when not.

    When I have my app running on my phone and make a request, I don't get a reply.
    The request doesn't even make it to my server, so that already explains why I don't get a reply.
    After a while, in my Application Output appears:
    [Qt Message] <Unknown File>:1: SyntaxError: Parse error

    I was able to load a webpage in the browser, so the phone has a working internet connection.
    Also the application can connect to the internet most of the time, only very sometimes it can't, so I assume it can't be a problem with the capabilities in the .pro file.

    Anybody has an idea about this problem why it happens, or how I can solve this?
    Thanks in advance

    Edit: I already figured out that after a long time, I do get a reply.
    But the reply is empty, which causes the error I get.
    Also, I can't find anything back in the logs of my server, so the request didn't reach the server.
    On some moments the connection works, on other moments it doesn't. So I still didn't find any solution :(

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Do you have the necessary capabilities (assuming you are on Symbian phone) set for your application?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mohsen
        wrote on last edited by
        #3

        why not integrate you project with C++ and using QTcpSocket? it's more stable than Http :)

        1 Reply Last reply
        0
        • _ Offline
          _ Offline
          _Arne
          wrote on last edited by
          #4

          Tobias: Yes, I'm on a symbian phone, and most of the times the network connection is working, so I assume it's not a problem with the capabilities.

          mohsen: I'll look up some information about it. But do you think it can solve the problem?
          edit: I've looked up some info about it, but I don't think that it can help me. The server I'm connecting to is an http server, so it would be easier to use QNetworkAccessManager then. But I already use that in some places, and there I also don't get a reply. So I think the problem must be somewhere else.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            DenisKormalev
            wrote on last edited by
            #5

            Tobias meant your application capabilities, not phone capabilities. Or you have network working in other parts of your app and it doesn't working only in this small part?

            1 Reply Last reply
            0
            • _ Offline
              _ Offline
              _Arne
              wrote on last edited by
              #6

              I was also talking about phone capabilities ;-) I have added NetworkServices in the .pro file.
              Well most of the time the application is working, everything. But very sometimes there's no network connection, in the whole application. But when I open the web browser, I can browse on internet, so it can't be that the phone doesn't have network access.

              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