Optimization. Delay refresh a piece internals update.
--HG-- branch : develop
This commit is contained in:
parent
bafb7ff70a
commit
73885ea890
|
@ -3578,7 +3578,7 @@ void VPattern::RefreshPieceGeometry()
|
|||
{
|
||||
for(auto piece : qAsConst(updatePieces))
|
||||
{
|
||||
piece->RefreshGeometry(true); // Refresh internal paths
|
||||
piece->RefreshGeometry();
|
||||
QApplication::processEvents();
|
||||
}
|
||||
updatePieces.clear();
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
#include <QKeyEvent>
|
||||
#include <QMenu>
|
||||
#include <QMessageBox>
|
||||
#include <QTimer>
|
||||
|
||||
// Current version of seam allowance tag need for backward compatibility
|
||||
const quint8 VToolSeamAllowance::pieceVersion = 2;
|
||||
|
@ -1335,6 +1336,11 @@ void VToolSeamAllowance::RefreshGeometry(bool updateChildren)
|
|||
m_seamAllowance->setPath(QPainterPath());
|
||||
}
|
||||
|
||||
if (qApp->IsAppInGUIMode())
|
||||
{
|
||||
QTimer::singleShot(100, this, [this, updateChildren]()
|
||||
{
|
||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, false);
|
||||
UpdateDetailLabel();
|
||||
UpdatePatternInfo();
|
||||
UpdateGrainline();
|
||||
|
@ -1343,6 +1349,20 @@ void VToolSeamAllowance::RefreshGeometry(bool updateChildren)
|
|||
{
|
||||
UpdateInternalPaths();
|
||||
}
|
||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateDetailLabel();
|
||||
UpdatePatternInfo();
|
||||
UpdateGrainline();
|
||||
UpdateExcludeState();
|
||||
if (updateChildren)
|
||||
{
|
||||
UpdateInternalPaths();
|
||||
}
|
||||
}
|
||||
|
||||
m_passmarks->setPath(futurePassmarks.result());
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user