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

Custom sorting of QStandardItem cannot be implemented

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.5.0, 6.4.3
    • 5.12.3
    • PySide
    • None
    • python 3.7.3
    • 2c795c34e (dev), bd2fc0d2c (6.4)

      When QStandardItem.__lt__ (corresponding to operator<) is implemented, it is never called. When using PyQt5, the attached code outputs

       

      before sort:
      Item(1)
      Item(0)
      __lt__(Item(0), Item(1)) called
      after sort:
      Item(0)
      Item(1)

      whereas for PySide the output is

       

      before sort:
      Item(1)
      Item(0)
      after sort:
      Item(1)
      Item(0)

        1. pyside1014_diag.diff
          2 kB
          Friedemann Kleint
        2. pyside1014.py
          1 kB
          Friedemann Kleint
        3. sort_bug.py
          0.9 kB
          Colin Gavin
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kleint Friedemann Kleint
            cgavin Colin Gavin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes