I can't seem to find any way to get a QTableWidget cell to word wrap its text, particularly if it is rich text (or text with simple HTML tags).

QTableWidgetItem doesn't provide any means to enable or set word wrapping parameters. Moreover, a QTableWidgetItem doesn't appear to support rich text or HTML.

If I try to employ a QLabel as a cell widget, I get rich text and word wrapping, but for some reason I lose normal table cell selection behavior. Clicking on such a cell produces no visual "selection" indication like a regular QTableWidgetItem does, while double-clicking on it turns the cell blue and leaves the text black.

What I am trying to do is build a single-column table in which each cell displays a piece of rich text (or simple HTML). I want the text in each cell to wrap to the width of the table and the height of each cell to grow to whatever height is necessary to display the entire wrapped text in that cell. Oh, and I want normal cell selection behaviors to be maintained.