I have hunted high and low for detailed documentation on the stylesheets for Qt widgets - specifically the QTableView widget. Here were some helpful (although incomplete) resources I found:
- https://doc.qt.io/qt-5/stylesheet-reference.html
- QTableView/QTableWidget grid stylesheet - grid line width
- How to set stylesheet for the current item in QTableView
I am simply trying to get a detailed (complete) list of stylesheet options for the QTableView. Where is this documentation? It seems strange that I have to get bits of information from all over the web to piece together a complete stylesheet.
Here is an example of the stylesheet I'm using right now:
QTableView {
color: black;
gridline-color: black;
border-color: rgb(242, 128, 133);
font: 10px;
}
QHeaderView::section {
background-color: rgb(71, 153, 176);
color: white;
height: 35px;
font: 14px;
}
QTableView::item:focus{
border: 2px solid rgb(242, 128, 133);
background-color: rgb(255, 254, 229);
}
QScrollBar:vertical {
background: rgb(188, 224, 235);
}
QScrollBar::handle:vertical {
background: rgb(71, 153, 176);
}
QScrollBar:horizontal {
background: rgb(188, 224, 235);
}
QScrollBar::handle:horizontal {
background: rgb(71, 153, 176);
}
This is what I still can't accomplish with the stylesheet:
- I would like to change the color of cells when they are selected in groups.
- This stylesheet has hidden the "rows" on my table
- I would like to edit the stylesheet for the rows as well.
Here you can see the cell behavior when selected in group:
I want the blue cells to match the style of the pink outlined cell.
What are the options for a QTableView widget? I have tried QTableView::rows, QTableView::selection, and many others to no luck.