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

QSortProxyFilterModel.data converts object to list

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • 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

    Description

      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__().

      Attachments

        1. main_bad.py
          2 kB
        2. main_good.py
          2 kB
        3. pyside-65-main_bad.py
          2 kB
        4. pyside-65-main_good.py
          2 kB

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes