void MainWindow::updateTable()
{
/*Read condor_status -l*/
int numRow=0;
int maxRow = m_model->rowCount(parent);
while((line = m_proc->readLine()).size() > 1){
do{
if(numRow >= maxRow){
m_model->insertRows(numRow,1,parent);
maxRow = m_model->rowCount(parent);
}
int numColumn = headerData(m_model,header);
QModelIndex index
= m_model
->index
(numRow,numColumn,parent
);
QString dataOld
= (m_model
->data
(index
)).
toString();
if(dataOld != dataNew){
m_model->setData(index, dataNew);
}
}while((line = m_proc->readLine()).size() > 1);
numRow++;
}
QTimer::singleShot(5000,
this,
SLOT(createProcess
()));
}
void MainWindow::updateTable()
{
/*Read condor_status -l*/
QModelIndex parent;
int numRow=0;
int maxRow = m_model->rowCount(parent);
QString line;
while((line = m_proc->readLine()).size() > 1){
do{
if(numRow >= maxRow){
m_model->insertRows(numRow,1,parent);
maxRow = m_model->rowCount(parent);
}
QString dataNew = line.split(' ', QString::SkipEmptyParts)[2];
QString header = line.split(' ',QString::SkipEmptyParts)[0];
int numColumn = headerData(m_model,header);
QModelIndex index = m_model->index(numRow,numColumn,parent);
QString dataOld = (m_model->data(index)).toString();
if(dataOld != dataNew){
m_model->setData(index, dataNew);
}
}while((line = m_proc->readLine()).size() > 1);
numRow++;
}
QTimer::singleShot(5000, this, SLOT(createProcess()));
}
To copy to clipboard, switch view to plain text mode
Bookmarks