FAQ Database Discussion Community


CSS to access QHeaderView item columns to set bacround-image, or set large icon to QHeaderView

css,qt,qt5,qheaderview
I need CSS access to all columns of the QHeaderView to set backround image to the first column i can access via: QHeaderView::section:horizontal:first{ background-image: url(:/Icons/icon_1.png); background-position:left; background-repeat:no-repeat; border: 1px solid #4B4B4B; } to the last column i can access via: QHeaderView::section:horizontal:last{ background-image: url(:/Icons/icon_5.png); background-position:left; background-repeat:no-repeat; border: 1px solid #4B4B4B; }...

What does QHeaderView::paintSection do such that all I do to the painter before or after is ignored

c++,qt,qpainter,qheaderview
This question is further development of this post and is different, though may seem similar as this one. I am trying to reimplement QHeaderView::paintSection, so that the background returned from the model would be honored. I tried to do this void Header::paintSection(QPainter * painter, const QRect & rect, int logicalIndex)...