Speed up loading pattern file by delaying garbage collecting.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-03-04 14:58:27 +02:00
parent d291051dfb
commit 6e60171bf7

View File

@ -4721,7 +4721,11 @@ bool MainWindow::LoadPattern(QString fileName, const QString& customMeasureFile)
{ // No errors occurred { // No errors occurred
/* Collect garbage only after successfully parse. This way wrongly accused items have one more time to restore /* Collect garbage only after successfully parse. This way wrongly accused items have one more time to restore
* a reference. */ * a reference. */
#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
QTimer::singleShot(100, Qt::CoarseTimer, this, [this](){doc->GarbageCollector(true);});
#else
doc->GarbageCollector(true); doc->GarbageCollector(true);
#endif
patternReadOnly = doc->IsReadOnly(); patternReadOnly = doc->IsReadOnly();
SetEnableWidgets(true); SetEnableWidgets(true);