From 7541a8205024368d9f0bdab311e5c6de6e3f8aac Mon Sep 17 00:00:00 2001 From: mgrojo Date: Sun, 22 Sep 2019 23:16:04 +0200 Subject: [PATCH] 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. --- src/FilterTableHeader.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FilterTableHeader.cpp b/src/FilterTableHeader.cpp index cd6894b3..c95f40b4 100644 --- a/src/FilterTableHeader.cpp +++ b/src/FilterTableHeader.cpp @@ -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);