Terminate pieces refresh if user called new parsing.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-05-28 11:36:03 +03:00
parent a66d0917ab
commit fdc8b96329
2 changed files with 22 additions and 0 deletions

View File

@ -172,6 +172,7 @@ void VPattern::Parse(const Document &parse)
break;
}
m_parsing = true;
SCASSERT(sceneDraw != nullptr)
SCASSERT(sceneDetail != nullptr)
static const QStringList tags({TagDraw, TagIncrements, TagPreviewCalculations});
@ -238,6 +239,7 @@ void VPattern::Parse(const Document &parse)
RefreshPieceGeometry();
}
emit CheckLayout();
m_parsing = false;
}
//---------------------------------------------------------------------------------------------------------------------
@ -3576,10 +3578,25 @@ quint32 VPattern::LastToolId() const
//---------------------------------------------------------------------------------------------------------------------
void VPattern::RefreshPieceGeometry()
{
if (qApp->IsGUIMode() && m_parsing)
{
return;
}
for(auto piece : qAsConst(updatePieces))
{
if (qApp->IsGUIMode() && m_parsing)
{
return;
}
piece->RefreshGeometry();
QApplication::processEvents();
if (qApp->IsGUIMode() && m_parsing)
{
return;
}
}
updatePieces.clear();
VMainGraphicsView::NewSceneRect(sceneDetail, qApp->getSceneView());

View File

@ -138,6 +138,11 @@ private:
VMainGraphicsScene *sceneDetail;
QVector<VToolSeamAllowance *> updatePieces;
/**
* @brief m_parsing true if parsing a pattern. Helps to stop updating piece when new parsing happend before
* finish */
bool m_parsing{false};
VNodeDetail ParseDetailNode(const QDomElement &domElement) const;
void ParseDrawElement(const QDomNode& node, const Document &parse);