From f4df67293554d9508da13d2905bf41d180a884d0 Mon Sep 17 00:00:00 2001 From: Michael Winkelmann Date: Wed, 7 Apr 2021 11:38:31 +0200 Subject: [PATCH] DefaultAnnotationsModel: handle default case as string Change-Id: I8a631f89f849b05c52e559b83ec63104156454df Reviewed-by: Thomas Hartmann --- .../components/annotationeditor/defaultannotations.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmldesigner/components/annotationeditor/defaultannotations.cpp b/src/plugins/qmldesigner/components/annotationeditor/defaultannotations.cpp index 3623dceeb95..f1fc72ab42d 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/defaultannotations.cpp +++ b/src/plugins/qmldesigner/components/annotationeditor/defaultannotations.cpp @@ -139,9 +139,6 @@ QVariantMap DefaultAnnotationsModel::asVariantMapFromJson(const QJsonDocument &d case QJsonValue::Double: map[key] = double{0.0}; break; - case QJsonValue::String: - map[key] = QString{}; - break; case QJsonValue::Bool: map[key] = false; break; @@ -161,6 +158,10 @@ QVariantMap DefaultAnnotationsModel::asVariantMapFromJson(const QJsonDocument &d else if (type == QStringLiteral("color")) map[key] = QVariant::fromValue(QColor(val.toString())); } + default: + case QJsonValue::String: + map[key] = QString{}; + break; } }