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

createIndex TypeError on 3rd argument

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.1
    • 5.12.0
    • PySide
    • None
    • Not really relevant but Windows 10 64-bit, Fedora 29 64-bit, CentOS 7 64-bit, Ubuntu 18.10 64-bit
    • Linux/Wayland, Linux/X11, Windows
    • c8970b29d76415d41fa383cbe5eb77eefb191fa1 (pyside/pyside-setup/5.12), 9c9448277 (dev), ddd875326 (6.7)

    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
          Marco Clemencic
        2. sa_workaround5.11.py
          4 kB
          Stefano Gariazzo
        3. sa.py
          3 kB
          Stuart Mentzer

        Issue Links

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

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              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