aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2015-12-10 16:17:00 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2015-12-10 16:31:11 +0000
commit48270d58a6170f81a6c8d79a42f5a2b6cb0942e5 (patch)
tree454cb4608117566ac384bfeea1ba9098a236a897
parent4b93663acd71c8c4e80a86184af7b0ea88d4bcf9 (diff)
SummaryPage: Be more robust wrt. selecting from the combobox
QComboBox::view() is the popup only, so do not use that to query for the selected value of the combobox. Task-number: QTCREATORBUG-15454 Change-Id: I1279a1c35e7e6f092d623199203ea50620690304 Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
-rw-r--r--src/plugins/projectexplorer/projectwizardpage.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp
index 965897b1e3..2f412d8833 100644
--- a/src/plugins/projectexplorer/projectwizardpage.cpp
+++ b/src/plugins/projectexplorer/projectwizardpage.cpp
@@ -128,6 +128,8 @@ QVariant AddNewTree::data(int, int role) const
return m_displayName;
if (role == Qt::ToolTipRole)
return m_toolTip;
+ if (role == Qt::UserRole)
+ return QVariant::fromValue(static_cast<void*>(node()));
return QVariant();
}
@@ -403,9 +405,8 @@ void ProjectWizardPage::setBestNode(AddNewTree *tree)
FolderNode *ProjectWizardPage::currentNode() const
{
- QModelIndex index = m_ui->projectComboBox->view()->currentIndex();
- TreeItem *item = m_model->itemForIndex(index);
- return item ? static_cast<AddNewTree *>(item)->node() : 0;
+ QVariant v = m_ui->projectComboBox->currentData(Qt::UserRole);
+ return v.isNull() ? 0 : static_cast<FolderNode *>(v.value<void *>());
}
void ProjectWizardPage::setAddingSubProject(bool addingSubProject)