You can try creating the string using Rich Text Format, but if QTableView or whatever you are using to display your model doesn't support it, then you are out of luck. Your only option at that point is to derive a QStyledItemDelegate that supports Rich Text and install that on the appropriate column(s) of your view.

Here's a StackOverflow question with both C++ and Python implementations you might be able to adapt. (See the answers, not the original question).