Multicolored text for tree/table/list items?
-
What is the fastest way to make the text of a tree item multicolored?
Like this: <black>Text</black><red>123</red>
I did some googling and found QStyledItemDelegate?
I don't see how to set the colors for regions though.
Do the items support html?Thank you!
-
By default: no. I have some code lying around that can do it, but it is not ready to be released. Vote for the associated "bug report":https://bugreports.qt.nokia.com/browse/QTBUG-14200 please.
-
The following "FAQ ":http://developer.qt.nokia.com/faq/answer/how_can_i_modify_the_color_for_individual_words_for_items_in_a_view provides an example that illustrates how this can be done by reimplementing "QItemDelegate::paint":http://doc.qt.nokia.com/latest/qitemdelegate.html.