forked from qt-creator/qt-creator
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:
@@ -117,8 +117,11 @@ void AssetExporterView::setState(AssetExporterView::LoadState state)
|
|||||||
qCDebug(loggerInfo) << "Loading state changed" << m_state;
|
qCDebug(loggerInfo) << "Loading state changed" << m_state;
|
||||||
if (inErrorState() || m_state == LoadState::Loaded) {
|
if (inErrorState() || m_state == LoadState::Loaded) {
|
||||||
m_timer.stop();
|
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)
|
if (m_state == LoadState::Loaded)
|
||||||
emit loadingFinished();
|
QTimer::singleShot(2000, this, &AssetExporterView::loadingFinished);
|
||||||
else
|
else
|
||||||
emit loadingError(m_state);
|
emit loadingError(m_state);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user