diff options
author | Thomas Hartmann <thomas.hartmann@qt.io> | 2023-12-21 15:29:14 +0100 |
---|---|---|
committer | Thomas Hartmann <thomas.hartmann@qt.io> | 2024-01-31 16:16:01 +0000 |
commit | ff3f8a5bc7438bd59a52009f72c330c09bacdb94 (patch) | |
tree | 388511d57bfd3bf2125bc36be2b3a855c2651ec5 | |
parent | 284ef9108f485bc4ea05f0acc63cc748c5979717 (diff) |
QmlDesigner: Remove unused code
Change-Id: I56a72af9251a1908f160c0e92b56addf69143169
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
-rw-r--r-- | src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index 037259e87e..9ab009bd83 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -652,60 +652,6 @@ public: return value; } - QVariant convertToVariant(const QString &astValue, const QString &propertyPrefix, AST::UiQualifiedId *propertyId) - { - const bool hasQuotes = astValue.trimmed().left(1) == u"\"" - && astValue.trimmed().right(1) == u"\""; - const QString cleanedValue = fixEscapedUnicodeChar(deEscape(stripQuotes(astValue.trimmed()))); - const Value *property = nullptr; - const ObjectValue *containingObject = nullptr; - QString name; - if (!lookupProperty(propertyPrefix, propertyId, &property, &containingObject, &name)) { - qCInfo(texttomodelMergerDebug) << Q_FUNC_INFO << "Unknown property" - << propertyPrefix + QLatin1Char('.') + toString(propertyId) - << "on line" << propertyId->identifierToken.startLine - << "column" << propertyId->identifierToken.startColumn; - return hasQuotes ? QVariant(cleanedValue) : cleverConvert(cleanedValue); - } - - if (containingObject) - containingObject->lookupMember(name, m_context, &containingObject); - - if (const CppComponentValue * qmlObject = value_cast<CppComponentValue>(containingObject)) { - const QString typeName = qmlObject->propertyType(name); - if (qmlObject->getEnum(typeName).isValid()) { - return QVariant(cleanedValue); - } else { - int type = QMetaType::type(typeName.toUtf8().constData()); - QVariant result; - if (type) - result = PropertyParser::read(type, cleanedValue); - if (result.isValid()) - return result; - } - } - - if (property->asColorValue()) - return PropertyParser::read(QVariant::Color, cleanedValue); - else if (property->asUrlValue()) - return PropertyParser::read(QVariant::Url, cleanedValue); - - QVariant value(cleanedValue); - if (property->asBooleanValue()) { - value.convert(QVariant::Bool); - return value; - } else if (property->asNumberValue()) { - value.convert(QVariant::Double); - return value; - } else if (property->asStringValue()) { - // nothing to do - } else { //property alias et al - if (!hasQuotes) - return cleverConvert(cleanedValue); - } - return value; - } - QVariant convertToEnum(AST::Statement *rhs, const NodeMetaInfo &metaInfo, const QString &propertyPrefix, |