aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/assetexporterplugin
diff options
context:
space:
mode:
authorVikas Pachdha <vikas.pachdha@qt.io>2020-06-18 19:32:19 +0200
committerVikas Pachdha <vikas.pachdha@qt.io>2020-06-19 12:28:29 +0000
commitf77d1df624ac968c78187e4f4e9853a9c84c6b4b (patch)
treed1b7a67981a9e275a6bafb446e3f5e39387167f5 /src/plugins/qmldesigner/assetexporterplugin
parentce942bd33c142cd52ef0b5765551f5bdf5dcd831 (diff)
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 <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/assetexporterplugin')
-rw-r--r--src/plugins/qmldesigner/assetexporterplugin/assetexporterview.cpp5
1 files changed, 4 insertions, 1 deletions
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);
}