diff options
Diffstat (limited to 'src/plugins/qmldesigner/components/connectioneditor/backendmodel.cpp')
-rw-r--r-- | src/plugins/qmldesigner/components/connectioneditor/backendmodel.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/qmldesigner/components/connectioneditor/backendmodel.cpp b/src/plugins/qmldesigner/components/connectioneditor/backendmodel.cpp index 4a004ca575..d64a9898a8 100644 --- a/src/plugins/qmldesigner/components/connectioneditor/backendmodel.cpp +++ b/src/plugins/qmldesigner/components/connectioneditor/backendmodel.cpp @@ -75,7 +75,7 @@ void BackendModel::resetModel() static const PropertyTypeList simpleTypes = {"int", "real", "color", "string"}; if (rewriterView) - for (const CppTypeData &cppTypeData : rewriterView->getCppTypes()) + for (const QmlTypeData &cppTypeData : rewriterView->getQMLTypes()) if (cppTypeData.isSingleton) { NodeMetaInfo metaInfo = m_connectionView->model()->metaInfo(cppTypeData.typeName.toUtf8()); if (metaInfo.isValid() && !metaInfo.isSubclassOf("QtQuick.Item")) { @@ -146,20 +146,20 @@ QStringList BackendModel::possibleCppTypes() const QStringList list; if (rewriterView) - foreach (const CppTypeData &cppTypeData, rewriterView->getCppTypes()) + foreach (const QmlTypeData &cppTypeData, rewriterView->getQMLTypes()) list.append(cppTypeData.typeName); return list; } -CppTypeData BackendModel::cppTypeDataForType(const QString &typeName) const +QmlTypeData BackendModel::cppTypeDataForType(const QString &typeName) const { RewriterView *rewriterView = m_connectionView->model()->rewriterView(); if (!rewriterView) - return CppTypeData(); + return QmlTypeData(); - return Utils::findOr(rewriterView->getCppTypes(), CppTypeData(), [&typeName](const CppTypeData &data) { + return Utils::findOr(rewriterView->getQMLTypes(), QmlTypeData(), [&typeName](const QmlTypeData &data) { return typeName == data.typeName; }); } @@ -173,7 +173,7 @@ void BackendModel::deletePropertyByRow(int rowNumber) /* singleton case remove the import */ if (data(index(rowNumber, 0), Qt::UserRole + 1).toBool()) { const QString typeName = data(index(rowNumber, 0), Qt::UserRole + 1).toString(); - CppTypeData cppTypeData = cppTypeDataForType(typeName); + QmlTypeData cppTypeData = cppTypeDataForType(typeName); if (cppTypeData.isSingleton) { @@ -207,14 +207,14 @@ void BackendModel::addNewBackend() if (!model) return; - AddNewBackendDialog dialog(Core::ICore::mainWindow()); + AddNewBackendDialog dialog(Core::ICore::dialogParent()); RewriterView *rewriterView = model->rewriterView(); QStringList availableTypes; if (rewriterView) - dialog.setupPossibleTypes(Utils::filtered(rewriterView->getCppTypes(), [model](const CppTypeData &cppTypeData) { + dialog.setupPossibleTypes(Utils::filtered(rewriterView->getQMLTypes(), [model](const QmlTypeData &cppTypeData) { return !cppTypeData.isSingleton || !model->metaInfo(cppTypeData.typeName.toUtf8()).isValid(); /* Only show singletons if the import is missing */ })); |