00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <qfont.h>
00019 #include "RioMMQListViewItem.h"
00020
00021 RioMMQListViewItem::RioMMQListViewItem( QListView *parent,
00022 RioMMQListViewItem *after, QColor color,
00023 bool bold )
00024 : QListViewItem ( parent, after )
00025 {
00026 boldfont = bold;
00027 fontcolor = color;
00028 }
00029
00030
00031 RioMMQListViewItem::RioMMQListViewItem( RioMMQListViewItem *parent,
00032 RioMMQListViewItem *after, QColor color,
00033 bool bold )
00034 : QListViewItem ( parent, after )
00035 {
00036 boldfont = bold;
00037 fontcolor = color;
00038 }
00039
00040 bool RioMMQListViewItem::getBold()
00041 {
00042 return boldfont;
00043 }
00044
00045 QColor RioMMQListViewItem::getColor()
00046 {
00047 return fontcolor;
00048 }
00049
00050 void RioMMQListViewItem::setBold( bool bold )
00051 {
00052 boldfont = bold;
00053 }
00054
00055 void RioMMQListViewItem::setColor( QColor color )
00056 {
00057 fontcolor = color;
00058 }
00059
00060 void RioMMQListViewItem::paintCell( QPainter *p, const QColorGroup &cg,
00061 int column, int width, int alignment )
00062 {
00063
00064 QFont newfont( p->font() );
00065 QFont oldfont( p->font() );
00066
00067 QColorGroup colorgroup( cg );
00068
00069 newfont.setBold( boldfont );
00070
00071 p->setFont( newfont );
00072
00073
00074 colorgroup.setColor( QColorGroup::Text, fontcolor );
00075
00076 QListViewItem::paintCell( p, colorgroup, column, width, alignment );
00077
00078
00079
00080 p->setFont( oldfont );
00081 }
00082