forked from qt-creator/qt-creator
DefaultAnnotationsModel: handle default case as string
Change-Id: I8a631f89f849b05c52e559b83ec63104156454df Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user