Feb-25-2020, 03:02 PM
Hi,
I have a QTableWidget on my GUI and when I want to style the table headers, it does not style the top left section of the table.
The table is set-up as follows with the associated style sheet:
Can someone help me with this?
I have a QTableWidget on my GUI and when I want to style the table headers, it does not style the top left section of the table.
The table is set-up as follows with the associated style sheet:
def create_table(gui): column_size = [100, 260, 150] columnLabels = ["A", "B", "C"] rowLabels = [] for i in range(50): rowLabels.append(str(i+1)) gui.table.setFixedWidth(sum(column_size)+34) gui.table.setFixedHeight(157) gui.table.verticalHeader().setMinimumSectionSize(23) gui.table.verticalHeader().setMaximumSectionSize(23) gui.table.verticalHeader().setDefaultSectionSize(23) gui.table.setHorizontalHeaderLabels(columnLabels) gui.table.setVerticalHeaderLabels(rowLabels) gui.table.verticalHeader().setVisible(True) gui.table.setFont(generalFont) cnt = 0 for column in column_size: gui.table.setColumnWidth(cnt, column) cnt += 1 gui.table.setStyleSheet("QHeaderView::section {background-color: rgba(100, 100, 100, 255); color: rgba(200, 200, 200, 255);}")The headers are correctly styled but the square in the top left corner above the row labels is not styled.
Can someone help me with this?