Details
-
Bug
-
Resolution: Invalid
-
P1: Critical
-
None
-
6.0.0 Alpha
-
None
Description
I noticed a change in behaviour while attempting to fix QtPIM unit tests to pass when built with Qt6. The following example shows the issue: I would expect a value "2.0" to be parsed as a double rather than an integral type.
#include <QCoreApplication> #include <QString> #include <QJsonDocument> #include <QJsonArray> #include <QJsonValue> #include <QtDebug> int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); // with Qt5 this produces QVariant(double, 2) // with Qt6 this produces QVariant(qlonglong, 2) qWarning() << QJsonDocument::fromJson(QStringLiteral("[ 2.0 ]").toUtf8()).array().at(0).toVariant(); return 0; }
This might be somehow related to the QTBUG-28560 changes although I'm not certain.