PDA

View Full Version : Problem with border radius on my QHeaderView



alienufo
17th June 2013, 19:47
9164

I'm having a problem with my header on a QTreeWidget. I've been trying to use a border radius on both the tree and the header, but around the header I get this white space where the corners would be if they were not rounded. See image. What I want it to do is show the background image instead of the white space. This works on the bottom of the QTreeWidget, so I'm fairly certain the problem is with the QHeaderView. I've tried various methods to fix this but have been unable to so far. Any help would be appreciated.

Here are the stylesheets ive used for these widgets:


QTreeWidget {
background-color: rgb(40, 41, 46);
color: rgb(203,204,207);
padding: 0px 0px 0px 0px;
outline: none;
border: 0px;
margin: 0px;
border-radius: 7px;
}

QTreeWidget::item:hover {
background-color: #202020;
color: #7ea229;
}

QTreeWidget::item:selected:active:!hover
{
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #88af2c, stop: 1 #718b31);
}

QTreeWidget::item:selected:!active:!hover
{
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #88af2c, stop: 1 #718b31);
}

QTreeWidget::branch:selected:closed:has-children:has-siblings {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #88af2c, stop: 1 #718b31);
}

QTreeWidget::branch:selected:open:has-children:has-siblings {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #88af2c, stop: 1 #718b31);
}
QHeaderView::section {
padding: 4px;
font: bold 11pt;
color: rgb(203, 204, 207);
background-color: rgb(26,27,31);
border-top-left-radius: 7px;
border-top-right-radius: 7px;
}

#catalogueItemHierarchyTree
{
border: 0px;
background-image: url(:/please-wait-bg200.png);
background-repeat: none;
background-position: center;
}

alienufo
18th June 2013, 18:33
Figured it out. This was the solution:

QTreeWidget > QFrame{ background-image: url(:/icons/Ribbon/ribbonbg.png);}

Didn't realize you could do the QTreeWidget > QFrame thing.

heipei
10th June 2015, 09:40
Hey I have the same issues but I don't understand this solution. Why is he setting an image? And what means QTreeWidget > QFrame

heipei
11th June 2015, 06:22
Mhm can nobody help me? :(