I worked with a bunch of examples I Googled, and looked at a bunch of questions about threading here on stackoverflow, but I still can't seem to get it.
Here is some sample code I am working with:
class Debugger(QTextBrowser):
def __init__(self, parent):
super(Debugger, self).__init__(parent)
sys.stdout = self
def write(self, text):
self.moveCursor(QTextCursor.End)
self.textCursor().insertText(text)
Basically, I am trying to catch any 'print' statements or other forms of writing to the stdoutstream. But I can't get it to print them one by one as they arrive. Instead, it waits until whatever process that prints the strings is finished, and then begins to log the information. So how do I thread this properly?
Edit: Reduced code to bare minimum.