CMS 3D CMS Logo

IgQtAppDebugInfo Class Reference

#include <Iguana/Studio/interface/IgQtAppDebug.h>

Inheritance diagram for IgQtAppDebugInfo:

IgQtAppDebugLibrariesInfo IgQtAppDebugPluginsInfo IgQtAppDebugResourceInfo IgQtAppDumpStateInfo

List of all members.

Public Slots

void exportList (void)
void info (void)
virtual void update (void)=0

Public Member Functions

 IgQtAppDebugInfo (QWidget *parent=0, bool autoRefresh=true)
 ~IgQtAppDebugInfo (void)

Protected Member Functions

void hideEvent (QHideEvent *)
QListView * list (void)

Private Member Functions

 IgQtAppDebugInfo (const IgQtAppDebugInfo &)
IgQtAppDebugInfooperator= (const IgQtAppDebugInfo &)
void start (void)

Private Attributes

bool m_autoRefresh
QListView * m_data
QTimer * m_timer


Detailed Description

Definition at line 23 of file IgQtAppDebug.h.


Constructor & Destructor Documentation

IgQtAppDebugInfo::IgQtAppDebugInfo ( QWidget *  parent = 0,
bool  autoRefresh = true 
)

Definition at line 45 of file IgQtAppDebug.cc.

References HLT_VtxMuL3::connect, exportList(), m_data, and update().

00047     : QDialog (parent),
00048       m_autoRefresh (autoRefresh),
00049       m_data (0),
00050       m_timer (0)
00051 {
00052     m_data               = new QListView (this);
00053     QHBox       *buttons = new QHBox (this);
00054     QPushButton *ok      = new QPushButton ("Close", buttons);
00055     QPushButton *refresh = new QPushButton ("Refresh", buttons);
00056     QPushButton *save    = new QPushButton ("Save List", buttons);
00057         
00058     buttons->setMargin (5);
00059     buttons->setSpacing (25);
00060 
00061     QVBoxLayout *vbox    = new QVBoxLayout (this);
00062 
00063     vbox->addWidget (m_data);
00064     vbox->addWidget (buttons);
00065 
00066     connect (ok, SIGNAL(clicked ()), this, SLOT(hide()));
00067     connect (refresh, SIGNAL(clicked ()), this, SLOT(update()));
00068     connect (save, SIGNAL(clicked ()), this, SLOT(exportList ()));
00069 }

IgQtAppDebugInfo::~IgQtAppDebugInfo ( void   ) 

Definition at line 71 of file IgQtAppDebug.cc.

References m_timer.

00072 {
00073     // FIXME: Does qt do these automatically?
00074     delete m_timer;
00075 }

IgQtAppDebugInfo::IgQtAppDebugInfo ( const IgQtAppDebugInfo  )  [private]


Member Function Documentation

void IgQtAppDebugInfo::exportList ( void   )  [slot]

Definition at line 86 of file IgQtAppDebug.cc.

References file, aod_PYTHIA_cfg::fileName, header, i, it, m_data, and TRUE.

Referenced by IgQtAppDebugInfo().

00087 {
00088     if (!m_data->firstChild ())
00089         return;
00090 
00091     QFileDialog* fileDialog = new QFileDialog (this, "File Dialog", TRUE);
00092     fileDialog->setMode (QFileDialog::AnyFile);
00093   
00094     QString fileName;
00095     if (fileDialog->exec () == QDialog::Accepted) 
00096     {
00097         fileName = fileDialog->selectedFile ();
00098     
00099         QFile file (fileName);
00100         if (!file.open (IO_WriteOnly))
00101             return;
00102 
00103         QTextStream textStream (&file);
00104 
00105         QListViewItemIterator it (m_data);
00106         QHeader *header =  m_data->header ();
00107 
00108         for ( ; it.current(); ++it) 
00109         {
00110             std::string tab("");
00111             int depth = it.current()->depth ();
00112             for(int i=0;i<depth; i++)
00113               tab+="  ";
00114             
00115             for (int i = 0; i < m_data->columns (); i++) 
00116             {
00117                 int orderedItem = header->mapToSection (i);
00118                 textStream <<tab.c_str ()<< it.current ()->text (orderedItem) << (it.current ()->pixmap (orderedItem) ? "*" : QString::null) << "\t";
00119             }
00120             textStream << "\n";
00121         }
00122         file.close();
00123     }
00124 }

void IgQtAppDebugInfo::hideEvent ( QHideEvent *  event  )  [protected]

Definition at line 127 of file IgQtAppDebug.cc.

References m_timer.

00128 {
00129     delete m_timer;
00130     m_timer = 0;
00131     QWidget::hideEvent (event);
00132 }

void IgQtAppDebugInfo::info ( void   )  [slot]

Definition at line 78 of file IgQtAppDebug.cc.

References start(), and update().

Referenced by IgQtAppDebug::dumpState(), IgQtAppDebug::libraries(), IgQtAppDebug::plugins(), and IgQtAppDebug::resources().

00079 {
00080     update ();
00081     show ();
00082     start ();
00083 }

QListView * IgQtAppDebugInfo::list ( void   )  [protected]

Definition at line 150 of file IgQtAppDebug.cc.

References m_data.

Referenced by IgQtAppDebugLibrariesInfo::IgQtAppDebugLibrariesInfo(), IgQtAppDebugPluginsInfo::IgQtAppDebugPluginsInfo(), IgQtAppDebugResourceInfo::IgQtAppDebugResourceInfo(), IgQtAppDumpStateInfo::IgQtAppDumpStateInfo(), IgQtAppDebugPluginsInfo::update(), IgQtAppDumpStateInfo::update(), IgQtAppDebugLibrariesInfo::update(), and IgQtAppDebugResourceInfo::update().

00151 {
00152     return m_data;
00153 }

IgQtAppDebugInfo& IgQtAppDebugInfo::operator= ( const IgQtAppDebugInfo  )  [private]

void IgQtAppDebugInfo::start ( void   )  [private]

Definition at line 135 of file IgQtAppDebug.cc.

References HLT_VtxMuL3::connect, m_autoRefresh, m_timer, lhef::timeout(), and update().

Referenced by info().

00136 {
00137     if (m_autoRefresh)
00138     {
00139         // Create the update timer
00140         if (! m_timer)
00141         {
00142             m_timer = new QTimer (this);
00143             connect (m_timer, SIGNAL(timeout()), this, SLOT(update()));
00144         }
00145         m_timer->start (5000);
00146     }
00147 }

virtual void IgQtAppDebugInfo::update ( void   )  [pure virtual, slot]

Implemented in IgQtAppDebugResourceInfo, IgQtAppDebugLibrariesInfo, IgQtAppDebugPluginsInfo, and IgQtAppDumpStateInfo.

Referenced by IgQtAppDebugInfo(), info(), and start().


Member Data Documentation

bool IgQtAppDebugInfo::m_autoRefresh [private]

Definition at line 42 of file IgQtAppDebug.h.

Referenced by start().

QListView* IgQtAppDebugInfo::m_data [private]

Definition at line 43 of file IgQtAppDebug.h.

Referenced by exportList(), IgQtAppDebugInfo(), and list().

QTimer* IgQtAppDebugInfo::m_timer [private]

Definition at line 44 of file IgQtAppDebug.h.

Referenced by hideEvent(), start(), and ~IgQtAppDebugInfo().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:25:26 2009 for CMSSW by  doxygen 1.5.4