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

createIndex TypeError on 3rd argument

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.12.0
    • Fix Version/s: 5.12.1
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      Not really relevant but Windows 10 64-bit, Fedora 29 64-bit, CentOS 7 64-bit, Ubuntu 18.10 64-bit
    • Platform/s:
      Linux/X11, Linux/Wayland, Windows
    • Commits:
      c8970b29d76415d41fa383cbe5eb77eefb191fa1 (pyside/pyside-setup/5.12)

      Description

      Classes inherited from QAbstractItemModel that implement index() will call createIndex(row, column, item). For a tree view you get the child item from the parent and you don't have the internal pointer to it. In the past (including PySide2 5.11.2) and with current PyQt5 passing the bare child item as the 3rd argument to createIndex() has worked fine. As of PySide2 5.12.0 I get:

      TypeError: 'PySide2.QtCore.QAbstractItemModel.createIndex' called with wrong argument types

       

      The attached is a simple example.

        Attachments

        1. sa_workaround.py
          4 kB
        2. sa_workaround5.11.py
          4 kB
        3. sa.py
          3 kB

          Issue Links

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

            Activity

              People

              • Assignee:
                crmaurei Cristian Maureira-Fredes
                Reporter:
                deadparrot Stuart Mentzer
              • Votes:
                7 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes