On the picture represented dialog window with only one widget class QTableWidget
. My problem is that bottom border of the header (red square, QHeaderView
class) is overlaps with left/right colored borders! What I want, is to make red squares sections view correctly, as green squares.
Here is CSS code from Qt Designer
which I'm using:
QTableView#tableWidget QHeaderView::section:horizontal
{
height: 24px;
border-style: none;
border-left: 1px solid #ecedef;
border-top: 1px solid #161618;
border-right: 1px solid #b1b1b5;
border-bottom: 1px solid #161618;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #f4f4f6, stop:1 #ceced6);
}
/*
QTableView#tableWidget QHeaderView::section:horizontal:first,
QTableView#tableWidget QHeaderView::section:horizontal:last
{
border-left-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #f4f4f6, stop:1 #ceced6);
}
*/
Thanks!
Update: Here is zoomed picture, just in case...
Formal definition border-right-width : medium. border-right-style : none. border-right-color : currentcolor.
I had understand how this stuff works!
Solution:
QTableView#tableWidget QHeaderView
{
/* draw the hole hor top & bottom line for the header */
height: 24px;
border-top: 1px solid #161618;
border-bottom: 1px solid #161618;
}
QTableView#tableWidget QHeaderView::section:horizontal:first
{
border-left-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #f4f4f6, stop:1 #ceced6);
}
QTableView#tableWidget QHeaderView::section:horizontal:last
{
border-right-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #f4f4f6, stop:1 #ceced6);
}
QTableView#tableWidget QHeaderView::section:horizontal
{
/* for each section draw ONLY left & right lines */
height: 24px;
border-style: none;
border-left: 1px solid #ecedef;
border-right: 1px solid #b1b1b5;
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #f4f4f6, stop:1 #ceced6);
}
And for additional the result figure how it looks:
Thanks anyway to all!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With