Add a QElapsedTimer to compute time used for reload element collection

This commit is contained in:
joshua
2022-02-06 15:50:25 +01:00
parent 72b7bc210f
commit 1a26133a78
2 changed files with 9 additions and 2 deletions

View File

@@ -619,7 +619,10 @@ void ElementsCollectionWidget::dirProperties()
*/
void ElementsCollectionWidget::reload()
{
m_loading_timer.reset(new QElapsedTimer());
qInfo()<<"Elements collection reload";
m_loading_timer->start();
m_progress_bar->show();
// Force to repaint now,
// else progress bar will be not displayed immediately
@@ -679,7 +682,8 @@ void ElementsCollectionWidget::loadingFinished()
m_progress_bar->hide();
m_tree_view->setEnabled(true);
qInfo()<<"Elements collection finished to be loaded";
qInfo()<<"Elements collection finished to be loaded in " << m_loading_timer->elapsed() << " ms";
m_loading_timer.reset();
}
/**