DefaultAnnotationsModel: handle default case as string

Change-Id: I8a631f89f849b05c52e559b83ec63104156454df
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Michael Winkelmann
2021-04-07 11:38:31 +02:00
parent 77d8a88a3e
commit f4df672935

View File

@@ -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;
}
}