PDA

View Full Version : Concerning the look and feel customization via CSS from the Qt’s widgets



schall_l
10th July 2008, 12:39
I found the style sheet reference at http://doc.trolltech.com/4.4-snapshot/stylesheet-reference.html somehow confusing about the possibilities to customize the sub-controls of a widget.

I would like to remove the dashed border of the text surrounding a QAbstractItemView, used in a QTreeWidget, when selected. The style sheet reference tells to use the ::item subcontrol for more fine grained control over the items in the QTreeView but also that ::text is the text of a QAbstractItemView.

So I’ve tried (without success) the following both possibilities:

QTreeView::text:selected:active {
border: 0px;
}

QTreeView::item::text:selected:active {
border: 0px;
}

Does someone has an idea ?

wysota
10th July 2008, 17:59
The border is there not because of selection but because the item has focus. It has nothing to do with text either. I'm not sure if you can do that using style sheets. But you can provide your own delegate for the view that will simply skip drawing the focus.