Make changes in the QtCreator side required for QDS new project dialog

* We need the showing of the Wizard dialog to be optional
* Each wizard has a "detailsPage.qml" file that stores wizard-specific
  UI configuration. We need a way to access that path (QUrl) from QDS.
* ComboboxField is used directly by QDS, and the field object is
  fetched by a call to JsonFieldPage::jsonField() - hence, the
  ComboboxField needs to be dllexported. We need to access fields
  directly from QDS because the QML controls use those fields as backend.
* From QDS we need to select / activate in a combobox field, and to see
  which item is current (activated). We also need to make use of the
  model that the ComboBoxField uses in order to show those same items in
  the qml controls of QDS.
* From QDS we need to set the text in a LineEditField

Task-number: QDS-4490
Change-Id: Ia42d539a5bcbf3dff4593fb027ac18c52da4d046
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Samuel Ghinet
2021-09-06 11:42:04 +03:00
parent 87c1f597e3
commit b985530144
9 changed files with 92 additions and 13 deletions

View File

@@ -701,6 +701,14 @@ void LineEditField::setupCompletion(FancyLineEdit *lineEdit)
}));
}
void LineEditField::setText(const QString &text)
{
m_currentText = text;
auto w = qobject_cast<FancyLineEdit *>(widget());
w->setText(m_currentText);
}
// --------------------------------------------------------------------
// TextEditFieldData:
// --------------------------------------------------------------------
@@ -1145,6 +1153,14 @@ QStandardItemModel *ListField::itemModel()
return m_itemModel;
}
void ListField::selectRow(int row)
{
auto index = itemModel()->index(row, 0);
selectionModel()->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
this->updateIndex();
}
QItemSelectionModel *ListField::selectionModel() const
{
return m_selectionModel;
@@ -1251,6 +1267,20 @@ QVariant ComboBoxField::toSettings() const
return {};
}
void ComboBoxField::selectRow(int row)
{
ListField::selectRow(row);
auto w = qobject_cast<QComboBox *>(widget());
w->setCurrentIndex(row);
}
int ComboBoxField::selectedRow() const
{
auto w = qobject_cast<QComboBox *>(widget());
return w->currentIndex();
}
void IconListField::setup(JsonFieldPage *page, const QString &name)
{
auto w = qobject_cast<QListView*>(widget());