1
0
forked from IPKM/nmreval

Display graph/set number in tree; fixes T243

This commit is contained in:
Dominik Demuth
2023-01-07 14:30:10 +01:00
parent 6eff9b5d91
commit 2c09573d2a
3 changed files with 38 additions and 4 deletions

View File

@ -231,5 +231,11 @@ class HeaderDelegate(QtWidgets.QStyledItemDelegate):
style = QtWidgets.QApplication.style()
style.drawControl(QtWidgets.QStyle.CE_HeaderSection, header_option, painter)
text_rect = style.subElementRect(QtWidgets.QStyle.SE_ItemViewItemText, option, None)
text_rect.adjust(2, 0, 0, 0)
if option.state & QtWidgets.QStyle.State_Selected:
painter.fillRect(option.rect, option.palette.highlight())
painter.fillRect(option.rect, option.palette.highlight())
painter.drawText(text_rect, option.displayAlignment, index.data(QtCore.Qt.DisplayRole))