forked from qt-creator/qt-creator
QmlDesigner: Fix Qt version handling in new project dialog
Different wizards may have different options for target Qt version, so don't hardcode them, but query them from the wizard. Also initialize the default target Qt version index to correct value in 3D wizard. Fixes: QDS-10223 Change-Id: I75f6bf60655692c52b1350182bf3ac122efc1c74 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -220,6 +220,21 @@ QString WizardHandler::targetQtVersionName(int index) const
|
||||
return text;
|
||||
}
|
||||
|
||||
QStringList WizardHandler::targetQtVersionNames() const
|
||||
{
|
||||
auto *field = m_detailsPage->jsonField("TargetQtVersion");
|
||||
auto *cbfield = dynamic_cast<ProjectExplorer::ComboBoxField *>(field);
|
||||
QTC_ASSERT(cbfield, return {});
|
||||
|
||||
QStandardItemModel *model = cbfield->model();
|
||||
QStringList targetVersions;
|
||||
|
||||
for (int i = 0; i < model->rowCount(); ++i)
|
||||
targetVersions.append(model->item(i)->text());
|
||||
|
||||
return targetVersions;
|
||||
}
|
||||
|
||||
int WizardHandler::targetQtVersionIndex(const QString &qtVersionName) const
|
||||
{
|
||||
auto *field = m_detailsPage->jsonField("TargetQtVersion");
|
||||
|
||||
Reference in New Issue
Block a user