Commit fdf968de authored by Ulf Hermann's avatar Ulf Hermann

Debugger: Handle JSON null values when translating to python

Change-Id: I47aaeb564107642543ba8038fc175a2c2203bebc
Reviewed-by: default avatarEdward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent 4bdba9c1
......@@ -855,8 +855,14 @@ void DebuggerCommand::arg(const char *name, const QJsonValue &value)
static QJsonValue translateJsonToPython(const QJsonValue &value)
{
// TODO: Verify that this covers all incompatibilities between python and json.
// TODO: Verify that this covers all incompatibilities between python and json,
// e.g. number format and precision
switch (value.type()) {
// Undefined is not a problem as the JSON generator ignores that.
case QJsonValue::Null:
// Python doesn't understand "null"
return QJsonValue(0);
case QJsonValue::Bool:
// Python doesn't understand lowercase "true" or "false"
return QJsonValue(value.toBool() ? 1 : 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment