Avoid deadlocks.
Added eventFilter to while processing query.