debugged run loop and tied it into Qt's event loop instead.