ProjectExplorer: Prevent detaching from QHash in loop

Change-Id: I8e52a57a24a7ab42fdf29a8b501e892f8c6d9469
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Christian Kandeler
2024-11-05 10:45:09 +01:00
parent 4f2eb122df
commit e934e6e5af

View File

@@ -550,7 +550,8 @@ void ToolChainOptionsWidget::apply()
Q_ASSERT(m_toRemoveList.isEmpty()); Q_ASSERT(m_toRemoveList.isEmpty());
// Update tool chains: // Update tool chains:
for (const QPair<StaticTreeItem *, StaticTreeItem *> &autoAndManual : m_languageMap) { for (const QPair<StaticTreeItem *, StaticTreeItem *> &autoAndManual :
std::as_const(m_languageMap)) {
for (StaticTreeItem *parent : {autoAndManual.first, autoAndManual.second}) { for (StaticTreeItem *parent : {autoAndManual.first, autoAndManual.second}) {
for (TreeItem *item : *parent) { for (TreeItem *item : *parent) {
auto tcItem = static_cast<ExtendedToolchainTreeItem *>(item); auto tcItem = static_cast<ExtendedToolchainTreeItem *>(item);