forked from qt-creator/qt-creator
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:
@@ -87,6 +87,8 @@ void ImportManagerView::importsChanged(const QList<Import> &/*addedImports*/, co
|
||||
|
||||
void ImportManagerView::possibleImportsChanged(const QList<Import> &/*possibleImports*/)
|
||||
{
|
||||
QmlDesignerPlugin::instance()->currentDesignDocument()->updateSubcomponentManager();
|
||||
|
||||
if (m_importsWidget)
|
||||
m_importsWidget->setPossibleImports(model()->possibleImports());
|
||||
}
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user