diff --git a/qmake/propertyprinter.cpp b/qmake/propertyprinter.cpp index 4ba56327e66..10c94942e15 100644 --- a/qmake/propertyprinter.cpp +++ b/qmake/propertyprinter.cpp @@ -5,6 +5,10 @@ #include +#include +#include +#include + QT_BEGIN_NAMESPACE void qmakePropertyPrinter(const QList> &values) @@ -22,11 +26,12 @@ void qmakePropertyPrinter(const QList> &values) void jsonPropertyPrinter(const QList> &values) { - std::cout << "{\n"; - for (const auto &val : values) { - std::cout << "\"" << qPrintable(val.first) << "\":\"" << qPrintable(val.second) << "\",\n"; - } - std::cout << "}\n"; + QJsonObject object; + for (const auto &val : values) + object.insert(val.first, val.second); + + QJsonDocument document(object); + std::cout << document.toJson().constData(); } QT_END_NAMESPACE