DQThread: Changed to use Qt's event loop to process the queue. It should avoid potential race condition.