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

Custom sorting of QStandardItem cannot be implemented

    XMLWordPrintable

Details

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

    Description

      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)

      Attachments

        1. pyside1014_diag.diff
          2 kB
        2. pyside1014.py
          1 kB
        3. sort_bug.py
          0.9 kB

        Issue Links

          For Gerrit Dashboard: PYSIDE-1014
          # Subject Branch Project Status CR V

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes