[Interest] Display XML in tree view

Murphy, Sean smurphy at walbro.com
Wed Aug 3 18:45:15 CEST 2016


> I think that's where you will need to use Roles, if you want different colors
> for different types of tree elements (element, attibute, cdata, text, etc)
> You'll set item.setData(color, colorRole, and the custom delegate will need to
> extract the color role and draw the text in that color.

I don't think roles helps here, because if you look at how your browser displays
the example page I linked in the previous email, there are MULTIPLE text colors
used within a single model index. For example, if the text of an index was 
  <title lang="en">Harry Potter</title>
The strings "title", "lang", "en", and "Harry Potter" may each have a different color
since they represent different things.

Sean


More information about the Interest mailing list