Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-669

Properly handle QByteArrays/Strings

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: P1: Critical P1: Critical
    • None
    • 5.9
    • PySide, Shiboken
    • None

      The current implementation of QByteArray is broken:

      • we should define the possible constructors,
      • the special methods _str_ and _repr_ need to be available
      • the possible operations needs to be defined (+?, *?)

      Keep in mind that we need to be Python 2 and 3 compatible,
      so we should provide a solution that is available using PyString_* methods and types (for python 2),
      and also PyUnicode_* (for python 3)

      A few questions are:

      • Should we treat a QByteArray as a PyByteArray or a String/Unicode ?
      • Should we treat Bytes as PyBytes? or Strings/Unicodes?
      • Since we are not providing a binding for QString, and instead we are using Python Strings, what should be the internal representation? (wchar_t?, char?, unsigned char?)

      There is currently a patch that try to solve this issue:
      https://codereview.qt-project.org/#/c/229678/

      and a couple of bugs related to this issue:
      https://bugreports.qt.io/browse/PYSIDE-232
      https://bugreports.qt.io/browse/PYSIDE-336
      https://bugreports.qt.io/browse/PYSIDE-100
      https://bugreports.qt.io/browse/PYSIDE-664

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

            Unassigned Unassigned
            crmaurei Cristian Maureira-Fredes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes