void SomeListViewItem
::paintCell( QPainter *p,
const QColorGroup
&cg,
int column, int w, int alignment )
{
QListViewItem::paintCell( p, cg, column, w, alignment );
double wGray = (double)m_iSinyalSeviyesi * w / 100;
double wWhite = (double)w - wGray;
// draw for column number 3 only
// let listview draw for other columns
if (column == 3) {
p->setBrush(gray);
p->drawRect(0, 5, (int)wGray, 32);
p->setBrush(white);
p->drawRect(wGray, 5, (int)wWhite, 32);
p->setPen(textColor);
p
->drawText
(w
/2-10, height
()/2+5,
QString(s
));
}
}
void SomeListViewItem::paintCell( QPainter *p, const QColorGroup &cg,
int column, int w, int alignment )
{
QListViewItem::paintCell( p, cg, column, w, alignment );
QColor gray(223, 221, 244);
QColor white(255, 255, 255);
QColor textColor(255, 0, 0);
double wGray = (double)m_iSinyalSeviyesi * w / 100;
double wWhite = (double)w - wGray;
// draw for column number 3 only
// let listview draw for other columns
if (column == 3) {
p->setBrush(gray);
p->drawRect(0, 5, (int)wGray, 32);
p->setBrush(white);
p->drawRect(wGray, 5, (int)wWhite, 32);
p->setPen(textColor);
p->drawText(w/2-10, height()/2+5, QString(s));
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks