I am facing and issue while setting tree view icon. It is setting at wrong place. I am using style-sheet.
I want something like second image.. Image with plus as an file extension.
tree_style = """
QTreeView {
background: #EBFEF4;
show-decoration-selected: 1;
}
QTreeView::item {
border: 1px solid #d9d9d9;
border-top-color: transparent;
border-bottom-color: transparent;
}
QTreeView::item:hover {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);
border: 1px solid #bfcde4;
}
QTreeView::item:selected {
border: 1px solid #567dbc;
}
QTreeView::item:selected:active{
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6ea1f1, stop: 1 #567dbc);
}
QTreeView::item:selected:!active {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6b9be8, stop: 1 #577fbf);
}
QTreeView::branch:has-siblings:!adjoins-item {
border-image: url(vline.png) 0;
}
QTreeView::branch:has-siblings:adjoins-item {
border-image: url(:/.png/branch-more.png) 0;
}
QTreeView::branch:!has-children:!has-siblings:adjoins-item {
border-image: url(:/.png/branch-end.png) 0;
}
QTreeView::branch:has-children:!has-siblings:closed,
QTreeView::branch:closed:has-children:has-siblings {
border-image: none;
image: url(:/.png/FolderClosed.png);
}
QTreeView::branchpen:has-children:!has-siblings,
QTreeView::branchpen:has-children:has-siblings {
border-image: none;
image: url(:/.png/FolderOpen.png);
}
"""
Added after 6 minutes:
I did this
QTreeView {
background: #EBFEF4;
show-decoration-selected: 1;
}
QTreeView::item {
border: 1px solid #d9d9d9;
border-top-color: transparent;
border-bottom-color: transparent;
image: url(:/.png/FolderClosed.png);
}
So icon came at right side.. But I want icon at left most side.
Bookmarks