Hi there,

I've been trying to figure this one out for several hours solid and I'm still drawing up a blank.

Pretty new to the Qt framework so please excuse my ignorance.

I want to make my treeview expand when the decoration (the icon) is clicked. For this I need to be able to distinguish between a click on the DecorationRole or a click on the DisplayRole.

My model has one column, and the data() method returns an icon for DecorationRole and text for DisplayRole.

One way around this is to use two columns, the first displaying the icon and the second displaying the text. This way I could tell which column was clicked and respond appropriately. However, when I do that, my text is no longer indented according to the hierarchical data. Would it be possible to work around this using a delegate? Would that still allow me to distinguish between clicks on columns?

Many thanks for any help.