Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
None
-
5.8.0 Alpha
-
None
Description
#include <QtQml> int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); QQmlEngine engine; QByteArray data = "{ \"foo\":\"bar\" }"; engine.rootContext()->setContextProperty("byteArrayData", data); engine.rootContext()->setContextProperty("stringData", QString::fromUtf8(data)); QQmlComponent component(&engine); component.setData("import QtQml 2.0; QtObject { Component.onCompleted: JSON.parse(stringData) }", QUrl("string")); component.create(); // ok component.setData("import QtQml 2.0; QtObject { Component.onCompleted: JSON.parse(byteArrayData) }", QUrl("bytearray")); component.create(); // bytearray:1: JSON.parse: Parse error }
Attachments
Issue Links
- resulted from
-
QTBUG-55337 QtQuick Controls examples broken on Android
- Closed
For Gerrit Dashboard: QTBUG-55562 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
169551,2 | Fix conversion of QByteArray back to String in JavaScript | 5.8 | qt/qtdeclarative | Status: MERGED | +2 | 0 |