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. Multi processes in a single GUI application.

Multi processes in a single GUI application.

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 5 Posters 2.0k 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.
  • chaithubkC Offline
    chaithubkC Offline
    chaithubk
    wrote on last edited by
    #1

    I have a custom QWidget that performs some graphics rendering and handles settings using Qt GUI elements, and there can be multiple widgets that can be invoked and plugged in to Tabbed Main Window. If I have to design each tab as a process itself so that it looks a single application to the user but each tab is a child process on its own. In this scenario, which is the best recommended IPC Mechanism that I can adopt.

    JonBJ fcarneyF 2 Replies Last reply
    0
    • chaithubkC chaithubk

      I have a custom QWidget that performs some graphics rendering and handles settings using Qt GUI elements, and there can be multiple widgets that can be invoked and plugged in to Tabbed Main Window. If I have to design each tab as a process itself so that it looks a single application to the user but each tab is a child process on its own. In this scenario, which is the best recommended IPC Mechanism that I can adopt.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @chaithubk
      Do you mean that these separate tabs/widgets are already separate processes, and there is nothing you can do about it? (BTW, you can't [easily] get widgets in other processes embedded into parent process.) Because unless this is how it has to be, it does not sound like you want sub-processes for choice here....

      chaithubkC 1 Reply Last reply
      2
      • JonBJ JonB

        @chaithubk
        Do you mean that these separate tabs/widgets are already separate processes, and there is nothing you can do about it? (BTW, you can't [easily] get widgets in other processes embedded into parent process.) Because unless this is how it has to be, it does not sound like you want sub-processes for choice here....

        chaithubkC Offline
        chaithubkC Offline
        chaithubk
        wrote on last edited by
        #3

        @jonb I wanted to check what would it take to implement each tab to be a separate process.

        JonBJ 1 Reply Last reply
        0
        • chaithubkC chaithubk

          @jonb I wanted to check what would it take to implement each tab to be a separate process.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @chaithubk
          If you really mean separate processes, you will not be able to have each process/tab content having QWidgets, or anything similar, which are somehow accessible to the main program/other tabs. Even if you did set some sort of IPC protocol, it would be slow/unwieldy/not doable to have much interaction between the tabs and the sub-processes.

          Basically a sub-process is a "black box" to the caller, and vice versa. You can only really communicate with it via stdin/out/err, or set up your own IPC sockets. It can't "put" widgets into your parent's UI.

          Given that, depending on what you want to do in the processes/tabs, if you are writing both the parent and the children you would be expected to implement them all in the same single Qt process. So what is your your use-case?

          chaithubkC 1 Reply Last reply
          0
          • JonBJ JonB

            @chaithubk
            If you really mean separate processes, you will not be able to have each process/tab content having QWidgets, or anything similar, which are somehow accessible to the main program/other tabs. Even if you did set some sort of IPC protocol, it would be slow/unwieldy/not doable to have much interaction between the tabs and the sub-processes.

            Basically a sub-process is a "black box" to the caller, and vice versa. You can only really communicate with it via stdin/out/err, or set up your own IPC sockets. It can't "put" widgets into your parent's UI.

            Given that, depending on what you want to do in the processes/tabs, if you are writing both the parent and the children you would be expected to implement them all in the same single Qt process. So what is your your use-case?

            chaithubkC Offline
            chaithubkC Offline
            chaithubk
            wrote on last edited by
            #5

            @jonb My use case is something like for example:
            When I launch my application it will have a Dock widget with a default tab which has dashboard with list of files. When I click on a file, I will have a file reader component that reads the file and displays it in the separate tab in the main application, same way from the dashboard I can click on an another file which again should display the file in a separate tab. Now I am thinking if it is possible to have each tab to be run as a different child process so that if one file fails to display it's contents or malfunctions it is just that tab that get's killed and the application will function with the rest of the files. Make sense ?

            JonBJ 1 Reply Last reply
            0
            • chaithubkC chaithubk

              @jonb My use case is something like for example:
              When I launch my application it will have a Dock widget with a default tab which has dashboard with list of files. When I click on a file, I will have a file reader component that reads the file and displays it in the separate tab in the main application, same way from the dashboard I can click on an another file which again should display the file in a separate tab. Now I am thinking if it is possible to have each tab to be run as a different child process so that if one file fails to display it's contents or malfunctions it is just that tab that get's killed and the application will function with the rest of the files. Make sense ?

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @chaithubk
              This is my last statement. I have tried each time to get you to explain what you mean by "a process which displays its output in a (parent process's tab)", or your "if it is possible to have each tab to be run as a different child process", and you have not answered or not understood. I don't see how you think you can have any sub-process output into a graphical widget in another process, which is what you keep saying you are going to do. But I have said this repeatedly so there is no more to say.

              I leave it now to you to discover for yourself, or someone else to explain so that you understand them.

              1 Reply Last reply
              0
              • chaithubkC chaithubk

                I have a custom QWidget that performs some graphics rendering and handles settings using Qt GUI elements, and there can be multiple widgets that can be invoked and plugged in to Tabbed Main Window. If I have to design each tab as a process itself so that it looks a single application to the user but each tab is a child process on its own. In this scenario, which is the best recommended IPC Mechanism that I can adopt.

                fcarneyF Offline
                fcarneyF Offline
                fcarney
                wrote on last edited by
                #7

                @chaithubk said in Multi processes in a single GUI application.:

                which is the best recommended IPC Mechanism that I can adopt

                I would do networking. It does not limit the processes to a particular machine. You could even write your front end to the processes in a browser if you wanted to. You will need a way to coordinate your list of processes and act as a broker. Something that can track and register a process with itself. Then whatever frontend connects can just query the broker.

                C++ is a perfectly valid school of magic.

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

                  Hi,

                  I wonder if the QtRemoteObjects module would be of help.

                  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
                  • S Offline
                    S Offline
                    Shazter
                    wrote on last edited by
                    #9

                    Which operating system?

                    If only Linux shall be supported, then I recommend D-BUS and QtWayland compositor, but please be noted is not a beginner job.

                    chaithubkC 1 Reply Last reply
                    0
                    • S Shazter

                      Which operating system?

                      If only Linux shall be supported, then I recommend D-BUS and QtWayland compositor, but please be noted is not a beginner job.

                      chaithubkC Offline
                      chaithubkC Offline
                      chaithubk
                      wrote on last edited by
                      #10

                      @shazter It's Windows desktop application. Yeah I started understanding it's not an easy task. I will read more through the documentation and put a proper technical question probably rather than just an idea.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        Shazter
                        wrote on last edited by
                        #11

                        Then the way to go would be TCP for IPC with QDataStream with good protocol or shared memory. I dont know which WindowManager is suitable Windows for the different processes. Maybe as good starting point for study is https://doc.qt.io/Neptune3UI/neptune3ui-overview.html, the source code is available in Github. Be aware is for Linux and not Windows.

                        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