From f77d1df624ac968c78187e4f4e9853a9c84c6b4b Mon Sep 17 00:00:00 2001 From: Vikas Pachdha Date: Thu, 18 Jun 2020 19:32:19 +0200 Subject: AssetExport: Delay the load signal from view Aparantly the QML file is not completely loaded when model is attached Change-Id: If8c342c057a1cd33b6f7510bbf9f56a1f3369961 Reviewed-by: Tim Jenssen --- src/plugins/qmldesigner/assetexporterplugin/assetexporterview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/qmldesigner/assetexporterplugin/assetexporterview.cpp') diff --git a/src/plugins/qmldesigner/assetexporterplugin/assetexporterview.cpp b/src/plugins/qmldesigner/assetexporterplugin/assetexporterview.cpp index 193ebce62a..1e47632c8e 100644 --- a/src/plugins/qmldesigner/assetexporterplugin/assetexporterview.cpp +++ b/src/plugins/qmldesigner/assetexporterplugin/assetexporterview.cpp @@ -117,8 +117,11 @@ void AssetExporterView::setState(AssetExporterView::LoadState state) qCDebug(loggerInfo) << "Loading state changed" << m_state; if (inErrorState() || m_state == LoadState::Loaded) { m_timer.stop(); + // TODO: Send the loaded signal with a delay. The assumption that model attached and a + // valid root object is enough to declare a QML file is ready is incorrect. A ideal + // solution would be that the puppet notifies file ready signal. if (m_state == LoadState::Loaded) - emit loadingFinished(); + QTimer::singleShot(2000, this, &AssetExporterView::loadingFinished); else emit loadingError(m_state); } -- cgit v1.2.1