0

I am designing a PyQt based application which has some components which do some heavy lifting in the GUI thread (live plotting some relatively large data-sets).

My experience is that other parts of my GUI can get somewhat unresponsive while this is happening - also I want to run multiple threads and avoid running into the old GIL problem.

To work around both of these issues, I want to run various parts of my application as separate processes (either using multiprocessing module or launching parallel python instances which communicate over sockets).

I am wondering if there is any way I can get the windows from the other processes to dock in my main window.

Minimal example by request:

sub_proc_a.py

from PyQt5 import QtWidgets

app = QtWidgets.QApplication([])

sub_process_window = QtWidgets.QWidget()
sub_process_window.setWindowTitle("Dock Me!")
sub_process_window.show()

app.exec_()

master_proc.py

from PyQt5 import QtWidgets
from subprocess import Popen

app = QtWidgets.QApplication([])

main_window = QtWidgets.QMainWindow()
main_window.setWindowTitle("Main window")
main_window.show()

sub_proc_a = Popen("python sub_proc_a.py")

# HOW DO I GET HANDLES TO THE WINDOWS OPENED by sub_proc_a such that I can dock them?

app.exec_()
Techniquab
  • 843
  • 7
  • 22

1 Answers1

0

After working on this issue for weeks, I have found what I'm looking for:

This document describes embedding other windows in Qt: https://gist.github.com/torarnv/c5dfe2d2bc0c089910ce

My other question here shows most of what's needed to dock the widget by hwnd value: Embedding native windows inside QDockWidget

Techniquab
  • 843
  • 7
  • 22