CMS 3D CMS Logo

AdvListViewItem.cc

Go to the documentation of this file.
00001 // (c) 1999 by Syntext, Inc.
00002 //
00003 // Authors: Timofey Fouriaev timof@syntext.com
00004 // Please see COPYING file for details.
00005 
00010 #include "Iguana/Studio/interface/AdvListView.h"
00011 #include "Iguana/Studio/interface/AdvListViewItem.h"
00012 #include <qpainter.h>
00013 
00014 AdvListViewItem::AdvListViewItem( QListView * parent )
00015     :QListViewItem(parent)
00016 {
00017     init();    
00018 }
00019 
00023 AdvListViewItem::AdvListViewItem( QListViewItem * parent )
00024     :QListViewItem(parent)
00025 {
00026     init();    
00027 }
00028 
00032 AdvListViewItem::AdvListViewItem( QListView * parent, QListViewItem * after )
00033     :QListViewItem(parent, after)
00034 {
00035     init();    
00036 }
00037 
00041 AdvListViewItem::AdvListViewItem( QListViewItem * parent, QListViewItem * after )
00042     :QListViewItem(parent, after)
00043 {
00044     init();    
00045 }
00046 
00053 AdvListViewItem::AdvListViewItem( QListView * parent,
00054                               QString label1,
00055                               QString label2,
00056                               QString label3,
00057                               QString label4,
00058                               QString label5,
00059                               QString label6,
00060                               QString label7,
00061                               QString label8 )
00062     :QListViewItem(parent, label1, label2, label3, label4, 
00063                    label5, label6, label7, label8)
00064 {
00065     init();    
00066 }
00067 
00077 AdvListViewItem::AdvListViewItem( QListViewItem * parent,
00078                               QString label1,
00079                               QString label2,
00080                               QString label3,
00081                               QString label4,
00082                               QString label5,
00083                               QString label6,
00084                               QString label7,
00085                               QString label8 )
00086     :QListViewItem(parent, label1, label2, label3, label4,
00087                    label5, label6, label7, label8)
00088 {
00089     init();    
00090 }
00091 
00102 AdvListViewItem::AdvListViewItem( QListView * parent, QListViewItem * after,
00103                               QString label1,
00104                               QString label2,
00105                               QString label3,
00106                               QString label4,
00107                               QString label5,
00108                               QString label6,
00109                               QString label7,
00110                               QString label8 )
00111     :QListViewItem(parent, after, label1, label2, label3, label4, 
00112                    label5, label6, label7, label8)
00113 {
00114     init();    
00115 }
00116 
00117 
00129 AdvListViewItem::AdvListViewItem( QListViewItem * parent, QListViewItem * after,
00130                               QString label1,
00131                               QString label2,
00132                               QString label3,
00133                               QString label4,
00134                               QString label5,
00135                               QString label6,
00136                               QString label7,
00137                               QString label8 )
00138     :QListViewItem(parent, after, label1, label2, label3, label4,
00139                    label5, label6, label7, label8)
00140 {
00141     init();    
00142 }
00143 
00144 void AdvListViewItem::init()
00145 {
00146     isBold_ = isItalic_ = isMagic_ = isCheckable_ = false;
00147 }
00148 
00149 void AdvListViewItem::paintCell( QPainter * p, const QColorGroup & cg,
00150                                int column, int width, int align )
00151 {
00152     QFont old_font( p->font());
00153     
00154     QFont new_font( p->font());
00155     new_font.setBold(isBold_);
00156     new_font.setItalic(isItalic_);   
00157     
00158     p->setFont(new_font);
00159     QListViewItem::paintCell(p, cg, column, width, align);
00160     p->setFont(old_font);
00161 }
00162 
00163 int AdvListViewItem::width( const QFontMetrics&,
00164                           const QListView* lv, int c ) const
00165 {  
00166     QFont new_font(listView()->font());
00167     new_font.setBold(isBold_);
00168     new_font.setItalic(isItalic_);   
00169     QFontMetrics fm_new(new_font);
00170   
00171     return QListViewItem::width(fm_new, lv, c);
00172 }
00173 
00174 void AdvListViewItem::setChecked(bool is_checked)  
00175 { 
00176     isChecked_ = is_checked; 
00177     AdvListView* list = static_cast<AdvListView*>(listView());
00178     if (list) 
00179         list->setChecked(this, is_checked);
00180 }

Generated on Tue Jun 9 17:38:49 2009 for CMSSW by  doxygen 1.5.4