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

QSortProxyFilterModel.data converts object to list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 1.0.8, 1.1.0
    • PySide
    • None
    • OS: Linux Fedora 16
      Python version: 2.7
      Qt version: 4.8.4
      PySide versions: 1.1.0 and 1.0.8

      My python object that has some definitions like a list but is much bigger than just that.

      The object contains __len__(), __contains__(), __getitem__().

      QSortProxyFilterModel.data(index, Qt.UserRole) returns the object as [] instead of the expected Asset type object.

      Tested with other objects that contain no __getitem__() etc. They work as expected.
      After converting __getitem__() to a normal method like get_asset() fixes this issue. However I prefer __getitem__().

        1. main_bad.py
          2 kB
          Jeroen Hoolmans
        2. main_good.py
          2 kB
          Jeroen Hoolmans
        3. pyside-65-main_bad.py
          2 kB
          Christian Tismer
        4. pyside-65-main_good.py
          2 kB
          Christian Tismer
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Unassigned Unassigned
            jhoolmans Jeroen Hoolmans
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes