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

QCborValue cannot be converted to some types if created via tag and value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.14.1, 5.15.0 Alpha
    • 5.13.1
    • Core: Other
    • None
    • - Manjaro Linux (Kernel Version 5.3.5)
      - Qt 5.13.1
      - GCC 9.2.0
    • All
    • bcbefcd6457adac9d92a410b1f7250ed5b0e8955 (qt/qtbase/5.14)

    Description

      When creating a QCborValue from tag and data, with the tag beeing a UUID, the resulting value cannot be converted to a QUuid:

      QCborValue iv{QUuid::createUuid()};
      qDebug() << iv.type()  // QCborValue::Type::Uuid
               << iv.tag()  // QCborKnownTags::Uuid
               << iv.taggedValue().type()  // QCborValue::Type::ByteArray
               << iv.toUuid()  // valid uuid, e.g. {92ed11be-9931-4c8e-85fe-a334ca1ce1a2}
               << iv.toVariant()  // valid uuid, same as toUuid()
      QCborValue tv{iv.tag(), iv.taggedValue()};
      qDebug() << tv.type()  // QCborValue::Type::Tag
               << tv.tag()  // QCborKnownTags::Uuid
               << tv.taggedValue().type()  // QCborValue::Type::ByteArray
               << tv.toUuid()  // invalid uuid {00000000-0000-0000-0000-000000000000}
               << tv.toVariant()  // QByteArray, contains the RFC representation of the uuid
      

      The same problem also exists for QRegularExpression and the RegularExpression tag. It works correctly for QUrl and QDateTime however...

      Attachments

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

        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