[companion][logsDialog]Improved, a bit, performance when opening a new log file.
This commit is contained in:
@@ -423,6 +423,10 @@ void logsDialog::on_fileOpen_BT_clicked()
|
|||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getOpenFileName(this,tr("Select your log file"), g.logDir());
|
QString fileName = QFileDialog::getOpenFileName(this,tr("Select your log file"), g.logDir());
|
||||||
if (!fileName.isEmpty()) {
|
if (!fileName.isEmpty()) {
|
||||||
|
|
||||||
|
QElapsedTimer timer;
|
||||||
|
timer.start();
|
||||||
|
|
||||||
g.logDir( fileName );
|
g.logDir( fileName );
|
||||||
ui->FileName_LE->setText(fileName);
|
ui->FileName_LE->setText(fileName);
|
||||||
if (cvsFileParse()) {
|
if (cvsFileParse()) {
|
||||||
@@ -453,19 +457,25 @@ void logsDialog::on_fileOpen_BT_clicked()
|
|||||||
ui->logTable->setItem(i-1,j,item );
|
ui->logTable->setItem(i-1,j,item );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui->logTable->resizeColumnsToContents();
|
ui->logTable->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||||
ui->logTable->resizeRowsToContents();
|
// ui->logTable->resizeColumnsToContents();
|
||||||
|
// ui->logTable->resizeRowsToContents();
|
||||||
// Hack - add some pixel of space to columns as Qt resize them too small
|
// Hack - add some pixel of space to columns as Qt resize them too small
|
||||||
for (int j=0; j<csvlog.at(0).count(); j++) {
|
// for (int j=0; j<csvlog.at(0).count(); j++) {
|
||||||
int width=ui->logTable->columnWidth(j);
|
// int width=ui->logTable->columnWidth(j);
|
||||||
ui->logTable->setColumnWidth(j,width+5);
|
// ui->logTable->setColumnWidth(j,width+5);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << timer.elapsed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool logsDialog::cvsFileParse()
|
bool logsDialog::cvsFileParse()
|
||||||
{
|
{
|
||||||
|
QElapsedTimer timer;
|
||||||
|
timer.start();
|
||||||
|
|
||||||
QFile file(ui->FileName_LE->text());
|
QFile file(ui->FileName_LE->text());
|
||||||
int errors=0;
|
int errors=0;
|
||||||
int lines=-1;
|
int lines=-1;
|
||||||
@@ -562,6 +572,8 @@ bool logsDialog::cvsFileParse()
|
|||||||
|
|
||||||
plotLock=false;
|
plotLock=false;
|
||||||
|
|
||||||
|
qDebug() << timer.elapsed();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user