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

Extend QByteArray to handle unsigned chars better

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.10
    • None

    Description

      QByteArray is often used to store binary data instead strings, e.g. in QtSerialBus.

      When working with the data, the signed char leads to surprising effects, e.g. when combining two chars to a short:

      quint16 word = payload.at(0) << 8 + payload.at(1);

      At the moment, this can only be solved by using reinterpret_cast<> at a lot of places.

      It would be nice to have possibilities to get unsigned char values in and out of a QByteArray.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            aha_1980 André Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes