Highlight column headers to emulate spreadsheet behaviour

The column headers contained in a selection are highlighted for
consistency to the row headers and to emulated spreadsheet behaviour.
This commit is contained in:
mgrojo
2019-09-22 23:16:04 +02:00
parent 5b73cd1481
commit 7541a82050

View File

@@ -17,6 +17,9 @@ FilterTableHeader::FilterTableHeader(QTableView* parent) :
// Make sure to not automatically resize the columns according to the contents
setSectionResizeMode(QHeaderView::Interactive);
// Highlight column headers of selected cells to emulate spreadsheet behaviour
setHighlightSections(true);
// Do some connects: Basically just resize and reposition the input widgets whenever anything changes
connect(this, &FilterTableHeader::sectionResized, this, &FilterTableHeader::adjustPositions);
connect(parent->horizontalScrollBar(), &QScrollBar::valueChanged, this, &FilterTableHeader::adjustPositions);