forked from qt-creator/qt-creator
QmlDesigner: Update possible modules for import changes
Maybe we should rename possibleImports in the module to modules() to make it clear. Task-number: QDS-9749 Change-Id: I46675d7eaca1f86ea4fe6e5841273e78a8ea2508 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> (cherry picked from commit dc4d0da49900b06588286e1c8799e9873cc34c8a)
This commit is contained in:
@@ -81,6 +81,7 @@ void ItemLibraryView::importsChanged(const Imports &addedImports, const Imports
|
|||||||
document->addSubcomponentManagerImport(import);
|
document->addSubcomponentManagerImport(import);
|
||||||
|
|
||||||
updateImports();
|
updateImports();
|
||||||
|
m_widget->updatePossibleImports(model()->possibleImports());
|
||||||
|
|
||||||
// TODO: generalize the logic below to allow adding/removing any Qml component when its import is added/removed
|
// TODO: generalize the logic below to allow adding/removing any Qml component when its import is added/removed
|
||||||
bool simulinkImportAdded = std::any_of(addedImports.cbegin(), addedImports.cend(), [](const Import &import) {
|
bool simulinkImportAdded = std::any_of(addedImports.cbegin(), addedImports.cend(), [](const Import &import) {
|
||||||
|
@@ -348,7 +348,7 @@ void ItemLibraryWidget::updateModel()
|
|||||||
|
|
||||||
void ItemLibraryWidget::updatePossibleImports(const Imports &possibleImports)
|
void ItemLibraryWidget::updatePossibleImports(const Imports &possibleImports)
|
||||||
{
|
{
|
||||||
m_addModuleModel->update(possibleImports);
|
m_addModuleModel->update(difference(possibleImports, m_model->imports()));
|
||||||
delayedUpdateModel();
|
delayedUpdateModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user