QmlDesigner: Fix showing assets on first add to a project

Fixes: QDS-4599
Change-Id: Idf2ec32adc490d9dbfc8c3ddc3b43cbf965d3b76
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2021-06-21 12:57:56 +03:00
parent 430e81facd
commit 95e82882ef

View File

@@ -232,9 +232,8 @@ ItemLibraryWidget::ItemLibraryWidget(AsynchronousImageCache &imageCache,
Q_UNUSED(changedDirPath)
// TODO: find a clever way to only refresh the changed directory part of the model
m_assetsModel->refresh();
if (!QApplication::activeModalWidget()) {
m_assetsModel->refresh();
// reload assets qml so that an overridden file's image shows the new image
QTimer::singleShot(100, this, [this] {
const QString assetsQmlPath = qmlSourcesPath() + "/Assets.qml";