QmlDesigner: why not delay it everywhere

Change-Id: Ic2df04e1e5dc6d1cbf8d01de5e3755df223976cb
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Tim Jenssen
2020-03-25 20:19:28 +01:00
parent 8b0cece0ba
commit 2246718cac

View File

@@ -98,15 +98,14 @@ void ItemLibraryView::setResourcePath(const QString &resourcePath)
void ItemLibraryView::documentMessagesChanged(const QList<DocumentMessage> &errors, const QList<DocumentMessage> &) void ItemLibraryView::documentMessagesChanged(const QList<DocumentMessage> &errors, const QList<DocumentMessage> &)
{ {
if (m_hasErrors && errors.isEmpty()) if (m_hasErrors && errors.isEmpty())
/* For some reason we have to call update from the event loop */ updateImports();
QTimer::singleShot(0, m_widget, &ItemLibraryWidget::updateModel);
m_hasErrors = !errors.isEmpty(); m_hasErrors = !errors.isEmpty();
} }
void ItemLibraryView::updateImports() void ItemLibraryView::updateImports()
{ {
m_widget->updateModel(); m_widget->delayedUpdateModel();
} }
} //QmlDesigner } //QmlDesigner