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. Python backend send data to GUI
Qt 6.11 is out! See what's new in the release blog

Python backend send data to GUI

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 1.2k Views 2 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.
  • E Offline
    E Offline
    EsaH
    wrote on last edited by
    #1

    Hi
    I would want to build application, which:

    1. Starts GUI application to frontend
    2. Starts Python script to background
    3. Receives message data from Python scripts (maybe every seconds)
    4. Show the messages in GUI on some table

    Does anyone good examples how to do that?

    Maybe it should have been to use QProcess ja QTimer ?

    BR Esa

    Pablo J. RoginaP 1 Reply Last reply
    0
    • E EsaH

      Hi
      I would want to build application, which:

      1. Starts GUI application to frontend
      2. Starts Python script to background
      3. Receives message data from Python scripts (maybe every seconds)
      4. Show the messages in GUI on some table

      Does anyone good examples how to do that?

      Maybe it should have been to use QProcess ja QTimer ?

      BR Esa

      Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by
      #2

      @EsaH said in Python backend send data to GUI:

      Starts GUI application to frontend

      What do you expect to write that GUI with: C++, QML, Python?

      Starts Python script to background

      If C++/QML from previous answer, how do you plan to run such scripts? using embedded interpreter? or just with external QProcess?

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

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

        Hi and welcome to devnet,

        What would that other script do ?
        How does it generate data ?
        How will you grab said data for your GUI ?

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

        E 1 Reply Last reply
        1
        • Pablo J. RoginaP Pablo J. Rogina

          @EsaH said in Python backend send data to GUI:

          Starts GUI application to frontend

          What do you expect to write that GUI with: C++, QML, Python?

          Starts Python script to background

          If C++/QML from previous answer, how do you plan to run such scripts? using embedded interpreter? or just with external QProcess?

          E Offline
          E Offline
          EsaH
          wrote on last edited by
          #4

          @Pablo-J-Rogina

          @Pablo-J-Rogina said in Python backend send data to GUI:

          @EsaH said in Python backend send data to GUI:

          Starts GUI application to frontend

          What do you expect to write that GUI with: C++, QML, Python?

          GUI is written by QML through C++.

          Starts Python script to background

          If C++/QML from previous answer, how do you plan to run such scripts? using embedded interpreter? or just with external QProcess?

          External QProcess would be better in that case for Python code.

          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi and welcome to devnet,

            What would that other script do ?
            How does it generate data ?
            How will you grab said data for your GUI ?

            E Offline
            E Offline
            EsaH
            wrote on last edited by
            #5

            @SGaist

            @SGaist said in Python backend send data to GUI:

            Hi and welcome to devnet,

            What would that other script do ?

            Actually it receives messages from a message broker (and also send messages to the broker).

            How does it generate data ?

            I think the script could use stdin and stdout channels to communicate with Qt application.

            How will you grab said data for your GUI ?

            Data comes from C++ backend to QML frontend.

            One solution could be to use sockets to connect Qt and external application, but i think QProcess would be easier in that case.

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

              What message broker are you using ?

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

              E 1 Reply Last reply
              0
              • SGaistS SGaist

                What message broker are you using ?

                E Offline
                E Offline
                EsaH
                wrote on last edited by
                #7

                @SGaist

                @SGaist said in Python backend send data to GUI:

                What message broker are you using ?

                RabbitMQ and AMQP 0.9.1 protocol.

                I know there are also exist https://github.com/ssproessig/qamqp/tree/develop but i am not sure how difficut it is use. I already have existing Python consumer and provider scripts for AMQP.

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

                  Since you are already using Python, did you consider using PySide2 or PyQt5 for your GUI application ? They can also use QML and you could directly leverage your existing Python code.

                  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
                  1

                  • Login

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