forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user