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. How to make localhost webpage
QtWS25 Last Chance

How to make localhost webpage

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtcpserverlocalhostqt creator
3 Posts 3 Posters 734 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
    duckrae
    wrote on 14 Apr 2022, 05:38 last edited by
    #1

    Hi. I wonder how to make localhost webpage.

    My QT app is showing sensor value in Raspberry Pi.

    Sensor and Raspberry Pi connect with using QTcpServer.

    Sensor and Raspberry Pi have to write and read packet.

    And then, I want to send sensor value to localhost webpage in Raspberry Pi.

    Here is the Problem, My localhost webpage example also use QTcpserver.

    When I combine two code, it not work.

    So, is there way to solve this problem?

    For example, using two QTcpServer code

    Or another solution?

    Advise Me. Please

    qt.png

    J 1 Reply Last reply 14 Apr 2022, 05:42
    0
    • D duckrae
      14 Apr 2022, 05:38

      Hi. I wonder how to make localhost webpage.

      My QT app is showing sensor value in Raspberry Pi.

      Sensor and Raspberry Pi connect with using QTcpServer.

      Sensor and Raspberry Pi have to write and read packet.

      And then, I want to send sensor value to localhost webpage in Raspberry Pi.

      Here is the Problem, My localhost webpage example also use QTcpserver.

      When I combine two code, it not work.

      So, is there way to solve this problem?

      For example, using two QTcpServer code

      Or another solution?

      Advise Me. Please

      qt.png

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 14 Apr 2022, 05:42 last edited by
      #2

      @duckrae said in How to make localhost webpage:

      is there way to solve this problem?

      Provide more information/code/errors

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SPlatten
        wrote on 14 Apr 2022, 06:26 last edited by SPlatten
        #3

        You need to create an AJAX client in your web-page. You could do this with a JavaScript timer that periodically requests data via a GET request to your application. Your application would need to listen for these requests using a TCP socket then respond.

        Depending on the amount of data you are going to be sending back to the client you may want to consider changing the method to a POST instead of GET as GET is limited in the data response to the URL length.

        You will also need to have a web-server, you could build a web-server into your application using TCP sockets, if not use Apache or something else for prototyping.

        Kind Regards,
        Sy

        1 Reply Last reply
        0

        3/3

        14 Apr 2022, 06:26

        • Login

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