+ self.io = QIODevice(self)
+ self.connect(self.io, SIGNAL('canReadLine()'), self.appendLine)
+
+ def redirectOutput(self):
+ print "Redirecting all output to Log Window. Please open the log window to see the output"
+ self.old_stdout = sys.stdout
+ self.old_stderr = sys.stderr
+ sys.stdout = self.io
+ sys.stderr = self.io
+
+ self.old_stdout.write("test")
+ self.text.append("io Test\n")
+
+ def appendLine(self):
+ self.text.append(self.io.readLine())
+