From 767e6e17d9909c2865c39721309dde90b979f3f9 Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@nokia.com>
Date: Fri, 5 Mar 2010 11:01:23 +0100
Subject: [PATCH] Make sure we have some target/Qt version selected

... in the TargetPage of the Qt4 wizards

Reviewed-by: Friedemann Kleint
---
 .../qt4projectmanager/wizards/targetspage.cpp       | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/plugins/qt4projectmanager/wizards/targetspage.cpp b/src/plugins/qt4projectmanager/wizards/targetspage.cpp
index eca5cf9ea67..97593ff3d18 100644
--- a/src/plugins/qt4projectmanager/wizards/targetspage.cpp
+++ b/src/plugins/qt4projectmanager/wizards/targetspage.cpp
@@ -113,6 +113,19 @@ void TargetsPage::setValidTargets(const QSet<QString> &targets)
         else
             currentTargetItem->setHidden(true);
     }
+
+    // Make sure we have something checked!
+    if (selectedTargets().isEmpty()) {
+        for (int i = 0; i < m_treeWidget->topLevelItemCount(); ++i) {
+            QTreeWidgetItem *currentTargetItem = m_treeWidget->topLevelItem(i);
+            QString currentTarget = currentTargetItem->data(0, Qt::UserRole).toString();
+            if (targets.contains(currentTarget) && currentTargetItem->childCount() >= 1) {
+                currentTargetItem->child(0)->setCheckState(0, Qt::Checked);
+                break;
+            }
+        }
+    }
+    emit completeChanged();
 }
 
 QSet<QString> TargetsPage::selectedTargets() const
-- 
GitLab