I have a slightly customized QTableView showing a model that I've developed. When I instruct the TableView to resizeColumnToContents, I end up with an extra buffer of about 20 pixels on either side of the column's text. This is major overkill for my table, as you can see below.

The user can manually resize the column to remove that buffer, but it's annoying when there are a lot of columns.
How might I change this buffer/margin size programmatically? I'm willing to use delegates, sizeHints, styleSheets, whatever it takes. I just can't find where this value is set.
Edit: Stepping through QHeaderView::sizeHint() and QHeaderView::sectionSizeFromContents() showed me that this is happening because I have sorting enabled (line 2588 of qheaderview.cpp). Disabling sorting removed the horizontal buffer.
Why on earth would the sizehint add a buffer of the header's height to its width if sorting is enabled? The sort indicator appears above the header (see below). The sort indicator has no relevance to the required column width. Weird.

I can't see a way around this other than implementing my own QHeaderView class. Is there a better way?