I need to subclass the QStyledItemDelegate of my QTableView. More particularly, I need to modify the display of a specific column. The cells in this column normally contains text. Here is a little part of my custom QStyledItemDelegate class:
elif index.column() == 3:
title = index.data()
painter.drawText(option.rect, QtCore.Qt.AlignCenter, title)
But I have a little problem, when I try to display it like this.
Expected:
Reality:
To get the expected picture, I just have to do nothing on this column in the StyledItemDelegate. I need to do the same as that, but with the function drawText.
Do you have any idea ?