:
Designer:
QTreeView#treeView
{
border: none;
background-color:#f0f0f1;
}
QTreeView#treeView::item,
QTreeView#treeView::branch
{
height: 25px;
border: none;
color: #564f5b;
}
QTreeView#treeView::item:selected,
QTreeView#treeView::branch:selected
{
border-bottom: none;
color: #ffffff;
background-image: url(:/backgrounds/images/backgrounds/kontragents_row_selection.png);
background-position: top left;
}
QTreeView#treeView::item:selected:!active,
QTreeView#treeView::branch:selected:!active
{
color: #ffffff;
}
paint():
void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const
{
QStyleOptionViewItemV4 opt = option;
opt.state &= ~QStyle::State_HasFocus;
QBrush brush = opt.backgroundBrush;
brush.setTexture( QPixmap( index.data( SORT_ROLE ).toBool()
? BACKGROUND_HIGH_PRIORITY
: BACKGROUND_STANDARD ) );
painter->save();
painter->fillRect( opt.rect, brush );
painter->restore();
QStyledItemDelegate::paint( painter, opt, index );
bool isIndexParent = !index.parent().isValid();
if( !isIndexParent )
{
QRect rect( 0, opt.rect.y(), 20, opt.rect.height() );
if( opt.state & QStyle::State_Selected )
{
brush.setTexture( QPixmap( BACKGROUND_SELECTED ) );
}
painter->save();
painter->fillRect( rect, brush );
painter->restore();
}
}
QTreeView:

!:)
PS: , , ...