qt: Fix richtext detection hang issue on very old Qt versions
qt: Fix richtext detection hang issue on very old Qt versions

Alternative implementation. Thanks to @awoland for the original.
Fixes #3486.

wastholm/bitcoin,wastholm/bitcoin,wastholm/bitcoin,wastholm/bitcoin,wastholm/bitcoin,wastholm/bitcoin