Hi all,
I want to add some additional painting to my subclassed headerview and i'm doing this:
protected:
void paintSection
(QPainter *painter,
const QRect &rect,
int logicalIndex
)const {
QHeaderView:: paintSection(painter, rect, logicalIndex
);
painter->save();
painter->drawText(rect.x(), rect.y() + rect.height(), "test");
painter->restore();
}
void paintSection(QPainter *painter, const QRect &rect, int logicalIndex)const
{
QHeaderView:: paintSection(painter, rect, logicalIndex);
painter->save();
painter->drawText(rect.x(), rect.y() + rect.height(), "test");
painter->restore();
}
To copy to clipboard, switch view to plain text mode
I thought it works just like overpainting the super class stuff, so I can keep the L&F and add something I want, but unfortunately the code after
QHeaderView:: paintSection(painter, rect, logicalIndex);
doesn't work.
When I leave it out, the 'test' text appears but the Look and the Feel are certainly away.
Any suggestions?
Bookmarks