void paintSection
(QPainter* painter,
const QRect
& rect,
int logicalIndex
) const {
const QString strTemp1
= model
()->headerData
(logicalIndex,Qt
::Vertical).
toString().
section("[",
0,
0);
const QString strTemp2
= model
()->headerData
(logicalIndex,Qt
::Vertical).
toString().
section("[",
1,
1);
painter->drawText(rect,Qt::AlignLeft,strTemp1);
if (!strTemp2.isEmpty())
painter->drawText(rect,Qt::AlignRight,"[" + strTemp2);
}
void paintSection(QPainter* painter, const QRect& rect, int logicalIndex) const
{
const QString strTemp1 = model()->headerData(logicalIndex,Qt::Vertical).toString().section("[",0,0);
const QString strTemp2 = model()->headerData(logicalIndex,Qt::Vertical).toString().section("[",1,1);
painter->drawText(rect,Qt::AlignLeft,strTemp1);
if (!strTemp2.isEmpty())
painter->drawText(rect,Qt::AlignRight,"[" + strTemp2);
QHeaderView::paintSection(painter,rect,logicalIndex);
}
To copy to clipboard, switch view to plain text mode
Bookmarks