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:
Miikka Heikkinen
2023-08-01 13:50:14 +03:00
parent d1623c38c6
commit 855c27de2a
6 changed files with 31 additions and 23 deletions

View File

@@ -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");