QmlDesigner: Fix flow tags not created after import on mac

Task-number: QDS-1220
Change-Id: Iecc1096f83f8f2edb3309854feed04d4c7fe4c9f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Mahmoud Badri
2020-04-15 18:17:09 +03:00
parent 475a0bd044
commit 0a447dfec8
2 changed files with 5 additions and 5 deletions

View File

@@ -87,6 +87,8 @@ void ImportManagerView::importsChanged(const QList<Import> &/*addedImports*/, co
void ImportManagerView::possibleImportsChanged(const QList<Import> &/*possibleImports*/) void ImportManagerView::possibleImportsChanged(const QList<Import> &/*possibleImports*/)
{ {
QmlDesignerPlugin::instance()->currentDesignDocument()->updateSubcomponentManager();
if (m_importsWidget) if (m_importsWidget)
m_importsWidget->setPossibleImports(model()->possibleImports()); m_importsWidget->setPossibleImports(model()->possibleImports());
} }

View File

@@ -512,20 +512,18 @@ void ItemLibraryAssetImporter::finalizeQuick3DImport()
addInfo(progressTitle); addInfo(progressTitle);
notifyProgress(0, 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, // 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. // 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. // Otherwise subsequent subcomponent manager update won't detect new imports properly.
QTimer *timer = new QTimer(parent()); QTimer *timer = new QTimer(parent());
static int counter; static int counter;
counter = 0; counter = 0;
timer->callOnTimeout([this, timer, progressTitle, doc]() { timer->callOnTimeout([this, timer, progressTitle, model]() {
if (!isCancelled()) { if (!isCancelled()) {
notifyProgress(++counter * 10, progressTitle); notifyProgress(++counter * 10, progressTitle);
if (counter >= 10) { 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(); timer->stop();
notifyFinished(); notifyFinished();
} }