[Qt-interest] text items in treeview different fonts?

Andre Somers andre at familiesomers.nl
Wed Aug 18 15:03:54 CEST 2010


  Op 18-8-2010 14:59, Eckhard Jokisch schreef:
> Hi,
> Is there any way to have some items in a TreeView shown in different fonts and
> colors? For example item 1,2 and 5 as text in 12pt-font and items 3,4,15 in
> 16pt-font?
1) use the appropriate data role for that directly from your model, or
2) create a proxy model to set that role from the proxy, or
3) create an item delegate to modify the item rendering directly.

3 is quite tricky, I think. 1 and 2 are reasonable solutions.

André




More information about the Qt-interest-old mailing list