QmlDesigner: Add imports to subcomponent manager whenever they change

Possible imports were never added to subcomponent manager after
initial design mode activation, and imports added manually via text
editor were also not added to subcomponent manager.

The old implementation also added duplicate imports to subcomponent
manager if imports were removed and readded to the document via
item library.

Fixes: QDS-5345
Change-Id: If45884f50b68282630af1d472af2816640b81c04
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Miikka Heikkinen
2021-10-29 15:39:05 +03:00
parent 3b62755061
commit 7ea6492a17
9 changed files with 33 additions and 21 deletions

View File

@@ -31,7 +31,6 @@
#include <nodeinstanceview.h>
#include <designeractionmanager.h>
#include <qmldesignerplugin.h>
#include <designersettings.h>
#include <qmldesignerconstants.h>
#include <viewmanager.h>
@@ -324,10 +323,6 @@ void Edit3DView::addQuick3DImport()
} else {
model()->changeImports({import}, {});
}
// Subcomponent manager update needed to make item library entries appear
QmlDesignerPlugin::instance()->currentDesignDocument()
->updateSubcomponentManagerImport(import);
return;
}
}