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

Assigning values to QCborValueRef breaks if changing type

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.14.1, 5.15.0 Alpha
    • 5.13.2
    • Core: Other
    • None
    • - Manjaro Linux (Linux 5.3.12-1-MANJARO x86_64 18.1.3 Juhraya)
      - Qt 5.13.2
    • All
    • 1f592da7f175aa75726eece2fab8f5c1edde193f (qt/qtbase/5.14)

    Description

      When assign a value to a QCborValueRef that has a different type as the value it is currently holding, a completely different value is assigned. This can happen when accessing a QCborMap or QCborArray via operator[]:

      QCborMap testMap;
      testMap[0] = QStringLiteral("value");
      testMap[0] = 42;
      qDebug() << testMap.value(0);  // returns "QCborValue(1)"
      

      This does not happen when assigning a value of a different type to a QCborValue. It also works correctly if assigning a value of the same type.

      Attachments

        For Gerrit Dashboard: QTBUG-80342
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            SkyCoder Felix Barz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes