[PyQt] Color characters in a qTreeWidgetItem

Hans-Peter Jansen hpj at urpla.net
Thu Jan 20 19:12:10 GMT 2011


On Thursday 20 January 2011, 18:32:38 Christopher Evans wrote:
> I would like to color specific characters in a tree widget item.
>
> I looked around a bit, any ideas? I can change all the text, this is
> what I am doing now, but I really need to just hilight different
> values int he string.

Hmm, usually one would reimplement paintEvent of some widget, but since 
you're in the model/view/delegate business, you need to subclass 
QStyledItemDelegate. Check out the itemviews/stardelegate.py example.

Pete



More information about the PyQt mailing list