QWebPage::selectedText() returns the selected text from a page. However, I would like to get the HTML. How can this be done?

For example, if the user selects this HTML:

The <b>quick brown fox</b> <img src="fox.jpg"/> jumps over the <em>lazy dog</em>.
QWebPage::selectedText() returns:

The quick brown fox jumps over the lazy dog.
That is, no HTML tags. I would like to get the HTML code too.

Thanks.