Fixed issue #859. Export to DXF in console never ends.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-06-21 14:46:55 +03:00
parent 598fea3969
commit 3db3d58961
2 changed files with 11 additions and 2 deletions

View File

@ -202,6 +202,12 @@ VDomDocument::VDomDocument(QObject *parent)
connect(m_watcher, &QFutureWatcher<QHash<quint32, QDomElement>>::finished, this, &VDomDocument::CacheRefreshed);
}
//---------------------------------------------------------------------------------------------------------------------
VDomDocument::~VDomDocument()
{
m_watcher->cancel();
}
//---------------------------------------------------------------------------------------------------------------------
QDomElement VDomDocument::elementById(quint32 id, const QString &tagName)
{
@ -608,7 +614,10 @@ void VDomDocument::CollectId(const QDomElement &node, QVector<quint32> &vector)
//---------------------------------------------------------------------------------------------------------------------
void VDomDocument::RefreshElementIdCache()
{
m_watcher->setFuture(QtConcurrent::run(this, &VDomDocument::RefreshCache, documentElement()));
if (m_watcher->isFinished())
{
m_watcher->setFuture(QtConcurrent::run(this, &VDomDocument::RefreshCache, documentElement()));
}
}
//---------------------------------------------------------------------------------------------------------------------

View File

@ -95,7 +95,7 @@ public:
static const QString TagLine;
explicit VDomDocument(QObject *parent = nullptr);
virtual ~VDomDocument() Q_DECL_EQ_DEFAULT;
virtual ~VDomDocument();
QDomElement elementById(quint32 id, const QString &tagName = QString());
template <typename T>