If a stylesheet defines the appearance for QHeaderView::section and it’s set for a QTableWidget before the widget is shown, the style is not applied to the horizontal header. The style is correctly set to the vertical header.
Setting the same stylesheet to the application or the horizontal header before showing the table widget works. Also setting the style to QTableWidget after the show() works correctly.
The code below shows this issue: