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

[Regression] QTreeView::sortByColumn(-1, Qt::AscendingOrder) is ignored

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Done
    • Affects Version/s: 5.13.0
    • Fix Version/s: 5.14.0 Alpha
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Environment:
      Reproduced on macOS (Qt 5.13.0 via Homebrew), Arch Linux (Qt 5.13.0 via package repositories)
    • Platform/s:
      All
    • Commits:
      de26ea6a7ff921995b6229f1f683821adb95e973 (qt/qtbase/5.13)

      Description

      Presumably since Qt 5.13.0, a QTreeView subclass that calls sortByColumn with -1 as parameter seems to have no effect. For some reason it now always adds a sorting indicator to the first column. This is a change in behavior compared to Qt 5.12.0 and before, previously it would maintain the natural sorting order.

      The documentation explicitly permits -1 as column: https://doc.qt.io/qt-5/qtreeview.html#sortByColumn

      The same application (Wireshark) has worked without issues before.

      Most likely introduced via https://codereview.qt-project.org/c/qt/qtbase/+/243900

      Downstream bug report: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15979

      CC Christian Ehrlicher, Shawn Rutledge, Richard Moe Gustavsen

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-77419
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              chehrlic Christian Ehrlicher
              Reporter:
              Lekensteyn Peter Wu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes