Hi,
Please can someone help with a problem I'm having with the QTreeWidget. The tree has only 1 column and I've set my tree up with the following so that I get appropriate scrollbars and item labels aren't truncated.

mytree->header()->setResizeMode(0, QHeaderView::ResizeToContents);
mytree->header()->setStretchLastSection(false);

The problem I have is that items in the tree seem to be sized to fit the entire width of the column. When you select and item in the tree the blue highlight is therefore stretched beyond the actual text of the item. For example, an item is selected and the highlight covers just the text. Then you sunsequently expand an item, (which results in the column being resized wider), the highlight of the selected item changes.

I want the item text only to be highlighted, (as per apps like windows explorer), and not the full width of the tree.

Any help would be appreciated.