Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-115210

Value mismatch between QJSonDocument and QString

    XMLWordPrintable

Details

    • All, Windows
    • edec095cf80b62057116ce75c581b5ca5866bdcc

    Description

      #include <QCoreApplication>
      #include <QDebug>
      #include <QJsonDocument>
      
      int main(int argc, char *argv[])
      
      {     QCoreApplication a(argc, argv);    
      
       
      
          QString tid = "
      
      {\"transactionId\":20230712203139768}
      
      ";
          qDebug() << "Result1: " << tid.toUtf8();
          QJsonDocument doc = QJsonDocument::fromJson(tid.toUtf8());
          qDebug() <<"Result2: "<<doc;
      
         
      
          return a.exec();
      }
      

      Result of using Qt 5.15 

      Result1:  "\{\"transactionId\":20230712203139768}"
      Result2:  QJsonDocument(\{"transactionId":20230712203139770})
      

       

      Result of using Qt 6.5

      Result1:  "\{\"transactionId\":20230712203139768}"
      Result2:  QJsonDocument(\{"transactionId":20230712203139768})
      

       

      Value mismatch issue occurred in Qt 5.15 version.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            benjamin_lee Benjamin Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes