Fixed exception bug when emitted from qt slot.