Why don't the signals emit from QThread ?
-
@SGaist @kshegunov I am afraid I have to change the status of this thread to unsolved because after successfully making a buffer that works with QPlainTextEdit (To remove delay in output). The problem started again because I set parents for every child of
PythonInterpreter
except for itself so I can move it to a thread when using the new buffer. Now the signals can't be emitted anymore again. It might not be a matter of them not emitting, but they are perhaps being queue in the EventLoop of the thread whileInteractiveConsole.runcode
is blocking.When I say the signals can't be emitted, they can't be emitted when/if I run a blocking function like time.sleep() is run in the interpreter. So this subsequently makes
InteractiveConsole.runcode
blocking. Is there a way around this ?Here is the new MCVE(Which is shorter now).
This is the signal not being emitted.
Any help would be amazing. Thank you !
-
What would you want to happen while that blocking code runs ?
-
@SGaist I need the slot
send_console_log
to be called when the signalwritten
inConsoleStream
is emitted. When running the program with a normal while/for loop in the interpreter, the slot will be called becuase at that moment its non blocking. But the moment I addtime.sleep
into a loop, slots will only be called at the end when all the blocking is over. Thank you for looking into this.