void myTable
::paintCell(QPainter *p,
int row,
int col,
const QRect &cr,
bool selected,
const QColorGroup
&cg
) {
int numRows = this->numRows();
int countRows = numRows;
for(int i = 0; i < numRows ; i++)
if (row == numRows-- || row == numRows+i || row == numRows-i || row == numRows+i
|| row ==numRows-i)
{
QColorGroup colorGroup(cg);
colorGroup.
setColor(QColorGroup
::Base,
QColor("#ffffbb"));
QTable::paintCell(p, row, col, cr, selected, colorGroup);
}
else
{
QTable::paintCell(p, row, col, cr, selected, cg);
}
}
void myTable::paintCell(QPainter *p, int row, int col, const QRect &cr, bool selected, const QColorGroup &cg)
{
int numRows = this->numRows();
int countRows = numRows;
for(int i = 0; i < numRows ; i++)
if (row == numRows-- || row == numRows+i || row == numRows-i || row == numRows+i
|| row ==numRows-i)
{
QColorGroup colorGroup(cg);
colorGroup.setColor(QColorGroup::Base, QColor("#ffffbb"));
QTable::paintCell(p, row, col, cr, selected, colorGroup);
}
else
{
QTable::paintCell(p, row, col, cr, selected, cg);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks