#include <Iguana/Studio/interface/IgQtAppDebug.h>
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 &) | |
IgQtAppDebugInfo & | operator= (const IgQtAppDebugInfo &) |
void | start (void) |
Private Attributes | |
bool | m_autoRefresh |
QListView * | m_data |
QTimer * | m_timer |
Definition at line 23 of file IgQtAppDebug.h.
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] |
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 78 of file IgQtAppDebug.cc.
References start(), and update().
Referenced by IgQtAppDebug::dumpState(), IgQtAppDebug::libraries(), IgQtAppDebug::plugins(), and IgQtAppDebug::resources().
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] |
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 }
Implemented in IgQtAppDebugResourceInfo, IgQtAppDebugLibrariesInfo, IgQtAppDebugPluginsInfo, and IgQtAppDumpStateInfo.
Referenced by IgQtAppDebugInfo(), info(), and start().
bool IgQtAppDebugInfo::m_autoRefresh [private] |
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().