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

Custom sorting of QStandardItem cannot be implemented

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.3
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      python 3.7.3

      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. 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.

          Activity

            People

            • Assignee:
              crmaurei Cristian Maureira-Fredes
              Reporter:
              cgavin Colin Gavin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes