Is it possible to turn a text in a header from a QStandardItemModel? I can't find a soloution.
Printable View
Is it possible to turn a text in a header from a QStandardItemModel? I can't find a soloution.
I've got the same issue, and can't find a solution.
If anyone have any suggestion..
My latest test, I've subclassed http://doc.qt.io/qt-4.8/qheaderview.html define http://doc.qt.io/qt-4.8/qheaderview.html#paintSection as this:
Code:
def __init__(self, *args, **kwargs): def paintSection(self, painter, rect, logicalIndex): painter.rotate(-90)
But the results are not really appropriate...
Not really sure about what to do.
Well, since a model doesn't have a header the original (year-old) question makes little sense.
Your approach with replacing the header view painting is good but you may also need to translate the drawing to keep it visible, and adjust the size of the sections (reimp. sectionSizeFromContents()) for the narrower width/taller height.
Thanks Chris for your answer !
I thought, I needed to do something for the dimensions... but i didn't know how, thanks !
I'm not sure to understand what you mean here:
Could you be more precise ?Quote:
you [...] need to translate the drawing to keep it visible