RioMMQListViewItem Class Reference

#include <RioMMQListViewItem.h>

Public Member Functions

 RioMMQListViewItem (QListView *parent, RioMMQListViewItem *after, QColor color, bool bold=false)
 RioMMQListViewItem (RioMMQListViewItem *parent, RioMMQListViewItem *after, QColor color, bool bold=false)
bool getBold ()
QColor getColor ()
void setBold (bool bold)
void setColor (QColor color)
virtual void paintCell (QPainter *p, const QColorGroup &cg, int column, int width, int alignment)

Private Attributes

bool boldfont
QColor fontcolor

Detailed Description

Definition at line 27 of file RioMMQListViewItem.h.


Constructor & Destructor Documentation

RioMMQListViewItem::RioMMQListViewItem ( QListView *  parent,
RioMMQListViewItem after,
QColor  color,
bool  bold = false 
)

Definition at line 21 of file RioMMQListViewItem.cpp.

00024     : QListViewItem ( parent, after )
00025 {
00026     boldfont = bold;
00027     fontcolor = color;
00028 }

RioMMQListViewItem::RioMMQListViewItem ( RioMMQListViewItem parent,
RioMMQListViewItem after,
QColor  color,
bool  bold = false 
)

Definition at line 31 of file RioMMQListViewItem.cpp.

00034     : QListViewItem ( parent, after )
00035 {
00036     boldfont = bold;
00037     fontcolor = color;
00038 }


Member Function Documentation

bool RioMMQListViewItem::getBold (  ) 

Definition at line 40 of file RioMMQListViewItem.cpp.

00041 {
00042     return boldfont;
00043 }

QColor RioMMQListViewItem::getColor (  ) 

Definition at line 45 of file RioMMQListViewItem.cpp.

00046 {
00047     return fontcolor;
00048 }

void RioMMQListViewItem::paintCell ( QPainter *  p,
const QColorGroup &  cg,
int  column,
int  width,
int  alignment 
) [virtual]

Definition at line 60 of file RioMMQListViewItem.cpp.

00062 {
00063     // Gera duas copias da fonte atual do objeto (newfont e oldfont).
00064     QFont       newfont( p->font() );
00065     QFont       oldfont( p->font() );
00066     // Gera uma copia do objeto com o grupo de cores.
00067     QColorGroup colorgroup( cg );
00068     // Altera o estilo em negrito da fonte newfont.
00069     newfont.setBold( boldfont );
00070     // Altera a fonte do dispositivo de pintura para a fonte newfont.
00071     p->setFont( newfont );
00072     // Altera a cor da fonte, no grupo de cores do objeto, para a cor
00073     // fontcolor.
00074     colorgroup.setColor( QColorGroup::Text, fontcolor );
00075     // Chama o procedimento de pintura da classe pai QListViewItem.
00076     QListViewItem::paintCell( p, colorgroup, column, width, alignment );
00077     // Restaura a fonte original do dispositivo de pintura (isso e necessario
00078     // para desenhar corretamente os outros itens da QListView da qual este
00079     // objeto pertence).
00080     p->setFont( oldfont );
00081 }

void RioMMQListViewItem::setBold ( bool  bold  ) 

Definition at line 50 of file RioMMQListViewItem.cpp.

00051 {
00052     boldfont = bold;
00053 }

void RioMMQListViewItem::setColor ( QColor  color  ) 

Definition at line 55 of file RioMMQListViewItem.cpp.

00056 {
00057     fontcolor = color;
00058 }


Field Documentation

Definition at line 30 of file RioMMQListViewItem.h.

Definition at line 33 of file RioMMQListViewItem.h.


The documentation for this class was generated from the following files:
Generated on Wed Jul 4 16:03:36 2012 for RIO by  doxygen 1.6.3