Terminate pieces refresh if user called new parsing.
--HG-- branch : develop
This commit is contained in:
parent
a66d0917ab
commit
fdc8b96329
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user