void Item::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ){ if(column == 0) { QPen oldPen(p->pen()); QPen newPen(p->pen()); newPen.setColor(red); p->setPen(newPen); QListViewItem::paintCell(p, cg, column, width, align); p->setPen(oldPen); return; } QListViewItem::paintCell(p, cg, column, width, align);}
void Item::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) { QPen newPen(p->pen()); if(column == 0) newPen.setColor(red); else newPen.setColor(black); p->setPen(newPen); QListViewItem::paintCell(p, cg, column, width, align); }
void DeviceItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ){ QColorGroup cg2(cg); if (!(m_device->isActive())) cg2.setColor(QColorGroup::Text, Qt::gray); // mark if there are critical issues if (!(m_device->issues().isEmpty())) { const DevIssueEntry& last_issue = m_device->issues().last(); if (last_issue.severity == DS_CRITICAL) { cg2.setColor(QColorGroup::Text, Qt::red); cg2.setColor(QColorGroup::Highlight, Qt::red); } } if (column) { QFont font(p->font()); font.setItalic(true); p->setFont(font); } QListViewItem::paintCell(p, cg2, column, width, align);}
void Item::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ){ QColorGroup _cg( cg ); QColor c = _cg.text(); if ( column == 0 ) _cg.setColor( QColorGroup::Text, Qt::red ); QListViewItem::paintCell( p, _cg, column, width, alignment ); _cg.setColor( QColorGroup::Text, c );}