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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_parsing = true;
|
||||||
SCASSERT(sceneDraw != nullptr)
|
SCASSERT(sceneDraw != nullptr)
|
||||||
SCASSERT(sceneDetail != nullptr)
|
SCASSERT(sceneDetail != nullptr)
|
||||||
static const QStringList tags({TagDraw, TagIncrements, TagPreviewCalculations});
|
static const QStringList tags({TagDraw, TagIncrements, TagPreviewCalculations});
|
||||||
|
@ -238,6 +239,7 @@ void VPattern::Parse(const Document &parse)
|
||||||
RefreshPieceGeometry();
|
RefreshPieceGeometry();
|
||||||
}
|
}
|
||||||
emit CheckLayout();
|
emit CheckLayout();
|
||||||
|
m_parsing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -3576,10 +3578,25 @@ quint32 VPattern::LastToolId() const
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPattern::RefreshPieceGeometry()
|
void VPattern::RefreshPieceGeometry()
|
||||||
{
|
{
|
||||||
|
if (qApp->IsGUIMode() && m_parsing)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for(auto piece : qAsConst(updatePieces))
|
for(auto piece : qAsConst(updatePieces))
|
||||||
{
|
{
|
||||||
|
if (qApp->IsGUIMode() && m_parsing)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
piece->RefreshGeometry();
|
piece->RefreshGeometry();
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
|
|
||||||
|
if (qApp->IsGUIMode() && m_parsing)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updatePieces.clear();
|
updatePieces.clear();
|
||||||
VMainGraphicsView::NewSceneRect(sceneDetail, qApp->getSceneView());
|
VMainGraphicsView::NewSceneRect(sceneDetail, qApp->getSceneView());
|
||||||
|
|
|
@ -138,6 +138,11 @@ private:
|
||||||
VMainGraphicsScene *sceneDetail;
|
VMainGraphicsScene *sceneDetail;
|
||||||
QVector<VToolSeamAllowance *> updatePieces;
|
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;
|
VNodeDetail ParseDetailNode(const QDomElement &domElement) const;
|
||||||
|
|
||||||
void ParseDrawElement(const QDomNode& node, const Document &parse);
|
void ParseDrawElement(const QDomNode& node, const Document &parse);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user