Skip to content
Snippets Groups Projects
Commit 48270d58 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

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: default avatarRobert Loehning <robert.loehning@theqtcompany.com>
parent 4b93663a
No related branches found
No related tags found
No related merge requests found
...@@ -128,6 +128,8 @@ QVariant AddNewTree::data(int, int role) const ...@@ -128,6 +128,8 @@ QVariant AddNewTree::data(int, int role) const
return m_displayName; return m_displayName;
if (role == Qt::ToolTipRole) if (role == Qt::ToolTipRole)
return m_toolTip; return m_toolTip;
if (role == Qt::UserRole)
return QVariant::fromValue(static_cast<void*>(node()));
return QVariant(); return QVariant();
} }
...@@ -403,9 +405,8 @@ void ProjectWizardPage::setBestNode(AddNewTree *tree) ...@@ -403,9 +405,8 @@ void ProjectWizardPage::setBestNode(AddNewTree *tree)
FolderNode *ProjectWizardPage::currentNode() const FolderNode *ProjectWizardPage::currentNode() const
{ {
QModelIndex index = m_ui->projectComboBox->view()->currentIndex(); QVariant v = m_ui->projectComboBox->currentData(Qt::UserRole);
TreeItem *item = m_model->itemForIndex(index); return v.isNull() ? 0 : static_cast<FolderNode *>(v.value<void *>());
return item ? static_cast<AddNewTree *>(item)->node() : 0;
} }
void ProjectWizardPage::setAddingSubProject(bool addingSubProject) void ProjectWizardPage::setAddingSubProject(bool addingSubProject)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment