Did you try using QSocketNotifier with STDIN as the socket descriptor? You don't need a thread for that...