diff --git a/src/plugins/qmldesigner/components/collectioneditor/collectionsourcemodel.cpp b/src/plugins/qmldesigner/components/collectioneditor/collectionsourcemodel.cpp index 5c4de3e4388..0c57f18778a 100644 --- a/src/plugins/qmldesigner/components/collectioneditor/collectionsourcemodel.cpp +++ b/src/plugins/qmldesigner/components/collectioneditor/collectionsourcemodel.cpp @@ -646,20 +646,28 @@ void CollectionSourceModel::registerCollection(const QSharedPointerproperty("_is_registered_in_sourceModel").toBool()) { + collectionList->setProperty("_is_registered_in_sourceModel", true); - connect(collectionList, &CollectionListModel::collectionNameChanged, this, - [this, collectionList](const QString &oldName, const QString &newName) { - onCollectionNameChanged(collectionList, oldName, newName); - }, Qt::UniqueConnection); + connect(collectionList, + &CollectionListModel::selectedIndexChanged, + this, + [this, collectionList](int idx) { onSelectedCollectionChanged(collectionList, idx); }); - connect(collectionList, &CollectionListModel::collectionsRemoved, this, - [this, collectionList](const QStringList &removedCollections) { - onCollectionsRemoved(collectionList, removedCollections); - }, Qt::UniqueConnection); + connect(collectionList, + &CollectionListModel::collectionNameChanged, + this, + [this, collectionList](const QString &oldName, const QString &newName) { + onCollectionNameChanged(collectionList, oldName, newName); + }); + + connect(collectionList, + &CollectionListModel::collectionsRemoved, + this, + [this, collectionList](const QStringList &removedCollections) { + onCollectionsRemoved(collectionList, removedCollections); + }); + } if (collectionList->sourceNode().isValid()) emit collectionNamesInitialized(collection->stringList());