mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Add a QElapsedTimer to compute time used for reload element collection
This commit is contained in:
@@ -619,7 +619,10 @@ void ElementsCollectionWidget::dirProperties()
|
|||||||
*/
|
*/
|
||||||
void ElementsCollectionWidget::reload()
|
void ElementsCollectionWidget::reload()
|
||||||
{
|
{
|
||||||
|
m_loading_timer.reset(new QElapsedTimer());
|
||||||
qInfo()<<"Elements collection reload";
|
qInfo()<<"Elements collection reload";
|
||||||
|
m_loading_timer->start();
|
||||||
|
|
||||||
m_progress_bar->show();
|
m_progress_bar->show();
|
||||||
// Force to repaint now,
|
// Force to repaint now,
|
||||||
// else progress bar will be not displayed immediately
|
// else progress bar will be not displayed immediately
|
||||||
@@ -679,7 +682,8 @@ void ElementsCollectionWidget::loadingFinished()
|
|||||||
m_progress_bar->hide();
|
m_progress_bar->hide();
|
||||||
m_tree_view->setEnabled(true);
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2021 The QElectroTech Team
|
Copyright 2006-2021 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
@@ -23,6 +23,8 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QModelIndex>
|
#include <QModelIndex>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QElapsedTimer>
|
||||||
|
#include <QScopedPointer>
|
||||||
|
|
||||||
class ElementsCollectionModel;
|
class ElementsCollectionModel;
|
||||||
class QVBoxLayout;
|
class QVBoxLayout;
|
||||||
@@ -111,6 +113,7 @@ class ElementsCollectionWidget : public QWidget
|
|||||||
|
|
||||||
bool m_first_show = true;
|
bool m_first_show = true;
|
||||||
QList<QETProject *> m_waiting_project;
|
QList<QETProject *> m_waiting_project;
|
||||||
|
QScopedPointer<QElapsedTimer> m_loading_timer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ELEMENTSCOLLECTIONWIDGET_H
|
#endif // ELEMENTSCOLLECTIONWIDGET_H
|
||||||
|
|||||||
Reference in New Issue
Block a user