What part of your code redirected the stdout? I mean qt probably did, atleast it used to anyway i dont have qt installed so i cant test. but this works fairly well in both tk an wxpython.
you can redirect sys.stdout to whatever you want with the
sys.stdout = maya.utils.Output()
you redirect it to maya script editor
sys.stderr = maya.utils.Output( error=1 )
redirects errors back to maya script editor
Offcourse if you wish them to go to the output window, or console in you can go and do:
sys.stdout = sys.__stdout__
sys.stderr = sys.__stderr__
or any file object really.
after this you can just use print wich is basically the same as sys.stdout.write()
I think that redirection itself is enough you dont really necceserily need to use utils.executeInMainThreadWithResult as long as the handle works. Didnt test tough.