diff --git a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp
index f32296a5ceb684981d647e0617f2c858d6a5abd8..d1aff03a3a40d3dde6b2e47b79aa366c929259ed 100644
--- a/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp
+++ b/src/plugins/qt4projectmanager/wizards/targetsetuppage.cpp
@@ -81,8 +81,21 @@ void TargetSetupPage::setImportInfos(const QList<ImportInfo> &infos)
     disconnect(m_treeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
                this, SLOT(itemWasChanged()));
 
-    // Clean up!
-    resetInfos();
+    // Create a list of all temporary Qt versions we need to delete in our existing list
+    QList<QtVersion *> toDelete;
+    foreach (const ImportInfo &info, m_infos) {
+        if (info.isTemporary)
+            toDelete.append(info.version);
+    }
+    // Remove those that got copied into the new list to set up
+    foreach (const ImportInfo &info, infos) {
+        if (info.isTemporary)
+            toDelete.removeAll(info.version);
+    }
+    // Delete the rest
+    qDeleteAll(toDelete);
+    // ... and clear the list
+    m_infos.clear();
 
     // Find possible targets:
     QStringList targets;
@@ -402,7 +415,6 @@ void TargetSetupPage::addShadowBuildLocation()
         return;
     }
     tmp.append(m_infos);
-    m_infos.clear(); // Clear m_infos without deleting temporary QtVersions!
     setImportInfos(tmp);
 }