mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Use multithreading for loading the element collection
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4542 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <QTreeView>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
#include <QtConcurrent>
|
||||
|
||||
#include "elementdialog.h"
|
||||
#include "qetapp.h"
|
||||
@@ -86,11 +87,15 @@ void ElementDialog::setUpWidget()
|
||||
m_tree_view = new QTreeView(this);
|
||||
|
||||
m_model = new ElementsCollectionModel(m_tree_view);
|
||||
if (m_mode == OpenElement) {m_model->addCommonCollection();}
|
||||
m_model->addCustomCollection();
|
||||
foreach (QETProject *project, QETApp::registeredProjects()) {
|
||||
m_model->addProject(project);
|
||||
}
|
||||
if (m_mode == OpenElement)
|
||||
m_model->addCommonCollection(false);
|
||||
m_model->addCustomCollection(false);
|
||||
|
||||
foreach (QETProject *project, QETApp::registeredProjects())
|
||||
m_model->addProject(project, false);
|
||||
|
||||
QList <ElementCollectionItem *> list = m_model->items();
|
||||
QtConcurrent::blockingMap(list, setUpData);
|
||||
|
||||
m_tree_view->setModel(m_model);
|
||||
m_tree_view->setHeaderHidden(true);
|
||||
|
||||
Reference in New Issue
Block a user