Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-16313

QJsonObject negative values not display correctly in watchlist whereas QJsonValue is fine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 4.0.1
    • Qt Creator 4.0.0
    • Debugger
    • None
    • Ubuntu 15.04 on x86_64
    • fbc82d3f88a736710474a95614767646a24077b2

    Description

      When a negative number (-1) is stored on a QJsonObject, it does not display corectly in watch list window. The same value is stored in a plain QJsonValue object, it does display correctly in the watch list window. Printing the QJsonObject instance does print out the correct value.

      SSCCE to reproduce issue

      1. Code

      `main.cpp`

      #include <QCoreApplication>
      #include <QJsonObject>
      #include <QDebug>

      int main(int argc, char *argv[])
      {
      QCoreApplication a(argc, argv);

      QJsonValue v(-1);
      qDebug()<<"v="<<v;

      QJsonObject obj {

      {"foo", -1}

      };
      qDebug()<<"obj="<<obj;

      return a.exec();
      }

      1. set a breakpoint on line 16:

      return a.exec();

      1. run in debug mode to the breakpoint and expand instance "obj" to see a value of 134217727 ( 0x7ffffff. log_2(134217727)= 26.99), whereas "v" simply has -1

      Attachments

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

        Activity

          People

            hjk hjk
            ross.rogers Ross Rogers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes