Prevents deadlocks with input in qt4