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

Header Sort not working in editable-tree-model-example

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 5.15.12
    • Documentation
    • None
    • All

    Description

      Hi there,

      I'm entirely new to your Qt Jira, and I hope it's OK to record my issue here in this way.

      This may not be a bug, but rather a feature availability for this particular case, but I'm trying to develop something on top of the editable-tree-model-example:

      https://doc.qt.io/qtforpython-6/examples/example_widgets_itemviews_editabletreemodel.html

      which works perfectly and does exactly what I'm looking for. However I noticed that sorting with the headers doesn't seem to work. I tried including the line

              self.view.setSortingEnabled(True)

      at line 27 of the file mainwindow.py, and although you can see the little arrow of up/down-sort on the header button changing when being clicked, nothing happens on the items below.

      I tried with the Dir-view example:

      https://doc.qt.io/qtforpython-6/examples/example_widgets_itemviews_dirview.html

      and the sorting works fine there, so I'm pretty sure it's not my environment that's the problem. Could it be that, by nature, being an editable tree, the text that's being displayed in the tree is not contained in the same attribute as a standard tree? and that this standard attribute used for sorting is actually "empty"?

      Anyway, any help would be amazing, I'd love to use your example.

      Many Thanks

      Stan

       

      Attachments

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

        Activity

          People

            kleint Friedemann Kleint
            spamela Stanislas Pamela
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes