Fix richtext detection hang issue on very old Qt versions