protected:
virtual void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const
{
QHeaderView::paintSection(painter, rect, logicalIndex);
painter->drawRect(2, 2, 10, 10);
}
矩形不是画。但是当 paintSection 被移除时,它正在绘画。我需要在调用基础paintSection 后绘制矩形。