Commit 48270d58 authored by Tobias Hunger's avatar Tobias Hunger

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
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment