Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-80959

Include documentation on how to implement the QAbstractItemModel::sort function when subclassing

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Documentation
    • Labels:
      None
    • Platform/s:
      All

      Description

      Hi.

       

      The documentation of QAbstractItemModel::sort, as well as the mvp programming guide, indicate that users can (and should) implement the `sort` method when subclassing QAbstractItemModel.

       

      However nowhere does the documentation describe how the function has to be implemented, and no one on the internet seems to know (I've just spent several hours looking). While the standard approach seems to use a QSortFilterProxyModel instead, there are cases in which it's necessary to implement the sort method directly.

       

      Would it be possible to add a description (or at least an example) on how to do so?

        Attachments

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

          Activity

            People

            • Assignee:
              docteam Qt Documentation Team
              Reporter:
              ldorigo Luca Dorigo
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes