Exemple #1
0
void DOMListViewItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment )
{
  QColorGroup _cg( cg );
  QColor c = _cg.text();

  p->setFont(m_font);
  _cg.setColor( QColorGroup::Text, m_color );
  QListViewItem::paintCell( p, _cg, column, width, alignment );
  _cg.setColor( QColorGroup::Text, c );
}
Exemple #2
0
void MessageListItem::paintCell( QPainter *p, const QColorGroup &cg,
				 int column, int width, int alignment )
{
    QColorGroup _cg( cg );
    QColor c = _cg.text();

    if ( myMessage->state() == Message::Unread )
	_cg.setColor( QColorGroup::Text, Qt::red );

    QListViewItem::paintCell( p, _cg, column, width, alignment );

    _cg.setColor( QColorGroup::Text, c );
}
void
K2sendPlayListItem::paintCell (QPainter * p, const QColorGroup & cg, int column, int width, int alignment)
{
    QColorGroup _cg (cg);
    QColor c = _cg.text ();
    if (_playing) {
        _cg.setColor (QColorGroup::Text, _color);
        //_cg.setColor( QColorGroup::Base, Qt::white );
        QListViewItem::paintCell (p, _cg, column, width, alignment);
    }
    if (isAlternate ())
        _cg.setColor (QColorGroup::Base, KGlobalSettings::alternateBackgroundColor ());
    QListViewItem::paintCell (p, _cg, column, width, alignment);


}
void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align)
{
  bool bPaintRed = false;
  if((column == COLUMN_RAWGAIN_INDEX && bColumn5Negative) ||
     (column == COLUMN_1WEEKGAIN_INDEX && bColumn6Negative) ||
     (column == COLUMN_4WEEKGAIN_INDEX && bColumn7Negative) ||
     (column == COLUMN_3MONGAIN_INDEX && bColumn8Negative) ||
     (column == COLUMN_YTDGAIN_INDEX && bColumn9Negative))
  {
    bPaintRed = true;
  }

  p->save();

  QColorGroup cg2(cg);

  if(isAlternate())
    cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor());
  else
    cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor());

#ifndef KMM_DESIGNER
  QFont font = KMyMoneyGlobalSettings::listCellFont();
  // strike out closed accounts
  if(m_account.isClosed())
    font.setStrikeOut(true);

  p->setFont(font);
#endif

  if(bPaintRed)
  {
    QColorGroup _cg( cg2);
    QColor c = _cg.text();
    _cg.setColor(QColorGroup::Text, Qt::red);
    QListViewItem::paintCell(p, _cg, column, width, align);
    _cg.setColor(QColorGroup::Text, c);
  }
  else
  {
    QListViewItem::paintCell(p, cg2, column, width, align);
  }

  p->restore();
}
void BaseTreeViewItem::paintCell(QPainter *p, const QColorGroup &cg,
                                 int column, int width, int align)
{
  QColorGroup _cg( cg );
  if (column == 0)
  {
    QFont f = p->font();
    if (quantaApp)
      f.setBold(ViewManager::ref()->isOpened(url()));
    p->setFont(f);
  } else
  {
    int h, s, v;
    p->pen().color().getHsv(&h, &s, &v);
    v = (v < 155 ? v + 100 : 255);
    _cg.setColor(QColorGroup::Text, QColor(h, s, v, QColor::Hsv));
  };
  KFileTreeViewItem::paintCell( p, _cg, column, width, align );
}