it's not this bug https://bugreports.qt.io/browse/QTBUG-53033 as in kmail now I use loading html from file I don't use setHtml directly but it's the same probem.
load test case:
select text in html => click "show selection" you will see correct selected text ok
now we load another html file (see html you will see "Akregator est un agrégateur de flux pour KDE. Load version <version number> !!!" so the html is changed
but now click on "show selection" you will see old selection!
For me it's a big bug in kmail as we can reply to email with selected text.