From 0a447dfec8d48395a5714a152ef8f50af16ec49b Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Wed, 15 Apr 2020 18:17:09 +0300 Subject: [PATCH] QmlDesigner: Fix flow tags not created after import on mac Task-number: QDS-1220 Change-Id: Iecc1096f83f8f2edb3309854feed04d4c7fe4c9f Reviewed-by: Thomas Hartmann --- .../components/importmanager/importmanagerview.cpp | 2 ++ .../components/itemlibrary/itemlibraryassetimporter.cpp | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp index f26178c4562..df9590af646 100644 --- a/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp +++ b/src/plugins/qmldesigner/components/importmanager/importmanagerview.cpp @@ -87,6 +87,8 @@ void ImportManagerView::importsChanged(const QList &/*addedImports*/, co void ImportManagerView::possibleImportsChanged(const QList &/*possibleImports*/) { + QmlDesignerPlugin::instance()->currentDesignDocument()->updateSubcomponentManager(); + if (m_importsWidget) m_importsWidget->setPossibleImports(model()->possibleImports()); } diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp index ee290d01f39..34fa71222d6 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetimporter.cpp @@ -512,20 +512,18 @@ void ItemLibraryAssetImporter::finalizeQuick3DImport() addInfo(progressTitle); notifyProgress(0, progressTitle); - // Trigger underlying qmljs snapshot update by making a non-change to the doc - model->rewriterView()->textModifier()->replace(0, 0, {}); - // There is an inbuilt delay before rewriter change actually updates the data model, // so we need to wait for a moment to allow the change to take effect. // Otherwise subsequent subcomponent manager update won't detect new imports properly. QTimer *timer = new QTimer(parent()); static int counter; counter = 0; - timer->callOnTimeout([this, timer, progressTitle, doc]() { + timer->callOnTimeout([this, timer, progressTitle, model]() { if (!isCancelled()) { notifyProgress(++counter * 10, progressTitle); if (counter >= 10) { - doc->updateSubcomponentManager(); + // Trigger underlying qmljs snapshot update by making a non-change to the doc + model->rewriterView()->textModifier()->replace(0, 0, {}); timer->stop(); notifyFinished(); }