Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.2, 5.0.1, 5.11.0
-
windows (including Windows 7) or linux
-
804a18ef0ec4a054778e223c8cec6ee26dec3f76 (qt/qtbase/5.12)
Description
QHeaderView does not respect BackgroundRole or DecorationRole as described in the documentation under Appearance: "QHeaderView respects the following item data roles: TextAlignmentRole, DisplayRole, FontRole, DecorationRole, ForegroundRole, and BackgroundRole."
Setting color or style of fonts (ForegroundRole or FontRole, respectively) in headerData() is working, but BackgroundRole is not respected, either by returning "QVariant(QColor(Qt::blue))" or "QBrush(QColor(Qt::blue))". Likewise, DecorationRole is ignored in headerData().
Attachments
Issue Links
- is duplicated by
-
QTBUG-57637 QTableWidgetItem::setBackground has no affect for horizontal header Item.
- Closed
-
QTBUG-58283 Background on QTableWidget headers.
- Closed
-
QTBUG-38912 QTableWidget: Custom background colors are not shown on horizontalHeader and verticalHeader when running Windows Aero Theme
- Closed
- relates to
-
QTBUG-107543 Regression[6.31->6.3.2, 6.26]: backgroundrole in QAbstractTableModel.headerData is broken (release builds only)
- Closed