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. Is it possible in Qt to run an external process inside a subwindow of the main process?

Is it possible in Qt to run an external process inside a subwindow of the main process?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.5k 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.
  • I Offline
    I Offline
    inopportuno
    wrote on last edited by
    #1

    I have a multi document program (call it HostProgram) . I would wish to have a process (call it GuestProcess) managing each open documents inside HostProgram in order to improve stability (if one of the Guest Process crashes I'm not forced to close the HostProgram and the other running GuestProccesses). Is it possible using Qt library to render the GUI composing GuestProcess inside a SubWindow of HostProcess? If yes how?

    Thanks in advance a lot for any help/hints you will be able to provide me.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      On windows you can pass window HWND of HostProgram as an argument to GuestProcess, and use it as parent window in GuestProcess.

      Qt way will be to use "QProcess":http://qt-project.org/doc/qt-4.8/qprocess.html and organize communication around read/write slots. So, GUI should be created in main program, but all data can be generated in guest process and signaled to host program.... You also can use sockets/pipes & shared memory...

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • I Offline
        I Offline
        inopportuno
        wrote on last edited by
        #3

        My problem is that I have in the GuestProcess an OpenGL context and for efficiency reasons I cannot detach it from the GuestProcess. So I would wish to maintain OpenGL context inside the GuestProcess but the QGLWidget should be rendered inside a SubWindow provided by the HostProcess.
        Something like the approach followed by Google Chrome that allocates a different process for each tab you opened.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AcerExtensa
          wrote on last edited by
          #4

          You can try this:

          Create and initialize QGLWidget in main thread

          create guest process and provide pointer to QGLWidget** as an argument or whatever

          use this pointer to draw whatever you want.

          Should work, but I've never played with QGLWidgets like what...

          God is Real unless explicitly declared as Integer.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            giesbert
            wrote on last edited by
            #5

            [quote author="AcerExtensa" date="1353921437"]You can try this:

            Create and initialize QGLWidget in main thread

            create guest process and provide pointer to QGLWidget** as an argument or whatever

            use this pointer to draw whatever you want.

            Should work, but I've never played with QGLWidgets like what...[/quote]

            Hi,

            this will not work. Pointer are only valid inside the process, that created them. Passing pointers from one process to another is not possible.

            Nokia Certified Qt Specialist.
            Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

            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