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>
This commit is contained in:
Vikas Pachdha
2020-06-18 19:32:19 +02:00
parent ce942bd33c
commit f77d1df624

View File

@@ -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);
}