QTableWidget and QHeaderView CSS

I can't seem to find a way to put the top-left side of the QHeaderView. Maybe part of it is QTableWidget, I can't tell ... Example: http://i.imgur.com/VmHHdan.png

History {
    background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 black, stop:1 gray);
}

* {
    font: 500 12pt "Cantarell";
    color: rgba(255, 255, 255, 200);
}

QTableWidget {
    background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 black, stop:1 blue);
}

QTableWidget::item {
    hborder: 5px solid rgba(68, 119, 170, 150);
    background-color:rgba(68, 119, 170, 125);
}

QHeaderView, QHeaderView::section {
    background-color: rgba(128, 128, 128, 128);
}

      

+3


source to share


1 answer


The corner widget is QTableWidget

implemented as QAbstractButton

it can be created using the selector QTableWidget QTableCornerButton::section

.

Warning . If you set it background-color

to only QTableCornerButton

, the background may not be displayed unless you set the property to a border

value. This is because it QTableCornerButton

creates its own border by default that completely overlaps the background color.



tableWidget.setStyleSheet("QTableWidget QTableCornerButton::section {"
    "background: red;"
    "border: 2px outset red;"
"}");

      

+5


source







All Articles