79691369

Date: 2025-07-05 22:07:00
Score: 1
Natty:
Report link

The fact that Qt does not implement a direct method to generate QIODevice-like signals for stdin implies that doing so is difficult or impossible.

The problem with using a separate QThread in the child to generate signals by blocking on sys.stdin.readline() is getting that QThread to exit. QThread.terminate() does not terminate that QThread until a line of input is received. All related answers ignore this problem.

I was able to workaround this by having the parent process feeding the child's stdin send "exit\n", and have the child's stdin-reading QThread detect that line and call its QThread.exit().

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Tom Roberts