Did you looked at the qutexr stuff? http://qutexr.sf.net
I'm creating a port to Qt 4.1, it works, but needs more testing.
Give me a shout if you need more info.